Result of Sum when used in a group

Stimulsoft Reports.NET discussion
Post Reply
MLauwerens
Posts: 2
Joined: Mon Oct 14, 2013 1:25 pm

Result of Sum when used in a group

Post by MLauwerens »

Hello

I recently started using this reporting tool and I cannot find out what I'm doing wrong.

I'm trying to calculate some percentages in a grouped report, but I keep getting wrong results.

Why does {Sum(DataResultCodes,ResultCodes.RCCount)} have a different result when used within a group ?

And what would be the right way to calculate the percentages ?

See example below

Code: Select all

HeaderResultcodes			Results	QTY		Pct.	Wrong		
							
GroupResultCodes - Header	Type A	12(A)	38,7%	100%(C)	
DataResultCodes					A1		1(B)	3,2%	8,3%(D)	
DataResultCodes					A2		6		19,4%	50,0%		
DataResultCodes					A3		5		16,1%	41,7%		
GroupResultCodes - Footer							
									Type B	19		61,3%	100%		
DataResultCodes					B1		7		22,6%	36,8%		
DataResultCodes					B2		3		9,7%	15,8%		
DataResultCodes					B3		9		29,0%	47,4%		
GroupResultCodes - Footer							
							
FooterResultCodes		Total			31(E)	100%			
							
(A)	{Sum(ResultGroup,ResultCodes.RCCount)}			
(B)	{ResultCodes.RCCount}						
(C)	{Div(Sum(ResultGroup,ResultCodes.RCCount),Sum(DataResultCodes,ResultCodes.RCCount),0)}		
(D)	{Div(ResultCodes.RCCount,Sum(DataResultCodes,ResultCodes.RCCount),0)}		
(E)	{Sum(DataResultCodes,ResultCodes.RCCount)}	
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Result of Sum when used in a group

Post by HighAley »

Hello.

We need more information to give you an answer.
Could you send us your report template with sample data which reproduces the issue?

Thank you.
MLauwerens
Posts: 2
Joined: Mon Oct 14, 2013 1:25 pm

Re: Result of Sum when used in a group

Post by MLauwerens »

Hello,

I cannot make an export because the "Save as" option is not yet implemented in the software that I use.

Let me explain in another way.

If I want to have a percentage in the "Top Sales" report. ( http://web.stimulsoft.com/?reportname=GroupsTopSales )

In such a way that the first line would be.

1.Beverages ( 17% ) Total: $ 12,480.25

What would be the formula to get to the 17%

Thank you
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Result of Sum when used in a group

Post by HighAley »

Hello.

It's possible to do with next expression:

Code: Select all

{Sum(Products.UnitsInStock * Products.UnitPrice)/Totals.Sum(DataBand1, Products.UnitsInStock * Products.UnitPrice)}
MLauwerens wrote:I cannot make an export because the "Save as" option is not yet implemented in the software that I use.
Could you specify what software do you use?

Thank you.
Post Reply