Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Query with Top N Condition (Result Row)

$
0
0

Hi,

 

I made a query with an active top n condition. The query has 2 Keyfigures and 1 formula

 

Gross-sales acutal | Gross-sales previous year | Previous Year %

 

So that to result line is correct, I had to say "Calculate result as summation" for the keyfigures

gross sales actual and gross sales previous year. That works.

 

I have the problem with my formula. the formular for previous year % is defined as follows:

 

gross sales actual %A gross sales previous year

 

Example Top 3 Customer

 

                    gross sales actual          gross sales prev. year         prev. year %

Cust 1          100                                   80                                       125 %

Cust 2          90                                     45                                        200 %

Cust 3           80                                    60                                        133 %

--------------------------------------------------------------------------------------------------------

Result          270                                   185                                       142.8 % ( 350 * 100 / 245 )

 

The result of 142 % is the correct result without the condition top 3. with the top 3 condition

the result should be 270 * 100 / 185 = 145.9 %

 

 

Additional customer without top 3 condition

 

Cust 4          50                                       40                                        125 %

Cust 5          30                                        20                                        150 %

 

 

 

It shows the correct result for each single line. The result in the result row is wrong. it is calculated

without taking the active condition. the formular calculates

with the total gross sales actual and the total of gross sales prev. year.

 

is there any solution the achieve the correct % in the result row?

 

thanks for your help.

 

Pascal


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>