Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Bestseller Report Post Reply Post New Topic
Author Message
koncuk
Newbie
Newbie


Joined: 03 Sep 2009
Online Status: Offline
Posts: 17
Quote koncuk Replybullet Topic: Bestseller Report
    Posted: 03 Sep 2009 at 4:07am

Hello ,

 I’m working on Crystal Report 11. I would like to create a best-seller report and to sort the list that sum of accounts (selling quantity) in the matrix system from best to least. I’m tring by group sort menu but it doesn’t work. In this wise groups are sorting by eachother as a firstand then sortibg by quantities. But I want to just sort by sum of selling quantities.

I need your help.

best regards.

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 03 Sep 2009 at 6:17am
have you tried making a formula that is something like:
sum({table.sellingQuantity})
and then group on that?
 
I don't guarantee that it will work, but it is the first thing that I would try.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 7:55am
Top N works well for this (your group sort expert attempt).
IN order for it to work you must first create a group and then secondly use  the insert summary and create a Summary for that group (Sum of accounts?)
Set your top N to a number greater then he number of values at your group level.
IP IP Logged
koncuk
Newbie
Newbie


Joined: 03 Sep 2009
Online Status: Offline
Posts: 17
Quote koncuk Replybullet Posted: 03 Sep 2009 at 10:11pm
Thanks,
 
but there is a formula in this field and I can't take sum of the formula. for example it is sum{(formul)} instead of sum({table.sellingQuantity}). when I write like this (sum{(formul)} ), I take a feedback " this is not a field to take sum."
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 Sep 2009 at 6:15am
the only way I compute a sum on a formula is through shared variables...you might be able to do a running total, that is DBlank's forte.
 
For a shared variable you will generally need 3 formulas.
1 to set the variable to zero:
shared numbervar aVar :=0;
 
1 to display the variable
shared numbervar aVar;
 
1 to increment the variable, this usually the hardest, but can be as simple as:
shared numbevar aVar;
if {table.field}=someCondition then
 aVar := aVar + 1;
""    // this hides the calculations on the report.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Sep 2009 at 7:01am
UNfortunately neither a Running Total nor a shared variable will allow you to use the GroupSort Top N.
What is your formula you are using?
IP IP Logged
koncuk
Newbie
Newbie


Joined: 03 Sep 2009
Online Status: Offline
Posts: 17
Quote koncuk Replybullet Posted: 08 Sep 2009 at 6:11am

I’m writing the formula of sum by formula fields instead of running total fields.

The formula is:

if {StockMove.Process}='02' and {StockMove.EQ}='Q' then {StockMove.Quantity}.

Results should be sort according to sum of the formula.

And I’m taking sorts by “all” instead of “Top N” in “Group Sort Expert” because I want to take all results.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Sep 2009 at 6:49am

based on that formula you should be able to do a Sum of it using the insert summary function and then use the top N to sort. I realize you want all the records that is why you make your N value in the Top N larger than the total number or records in your groups. It will still show all just change it to sort by the sum instead of alpha which is what you want correct?

IP IP Logged
koncuk
Newbie
Newbie


Joined: 03 Sep 2009
Online Status: Offline
Posts: 17
Quote koncuk Replybullet Posted: 09 Sep 2009 at 12:22am

I have solved my problem. I sum up fields I need to take by view from sql and I added the result as decreasing group in crystal report.

Thanks for your help.

Kinsly Regards.

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.