Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ravindraa
Creator
Creator

Expression issue in aggregation

Hi Exports,

  I have small issue on Multiplication .i have two tables like sales_file and price_file like below.

Country      SAPcode     year      Month       sales                       Country      SAPcode     year      Month       Price

AE                 12345           2019     1                 10                              AE                  12345           2019      1                2

AE                  23456          2019     2                 20                             AE                   23456            2019      2                3

 

Normal Process:-Normally if we load the data and create the expression like sum(sales)* sum(price) result is = 30*5  =150

 

Required Process:-but my requirement is in 2019 Jan month sales is 10 and same year same month price is 2 then multiply like 10*2 =20

same way second month also in 2019 Feb month sales is 20 and same year same month price is 3 then multiply like 20*3=60.

Normal expression is giving like below result

 

Country    Value(sum(sales) * Sum(Price))                                        Country        Value

AE                150                                                                                                 AE                   80  (Expected Result)

kindly give me any suggestion how to achieve .

I have attached sample application please find the same.

Thank you very much in advance........

5 Replies
ravindraa
Creator
Creator
Author

Hi Experts,

   kindly give any one of  the suggestion last one month on wards i am struggling the same issue .

 

Please help me .

Thanks in advance......

ravindraa
Creator
Creator
Author

Hi Experts,

   kindly give any one of  the suggestion last one month on wards i am struggling the same issue .

 

Please help me .

Thanks in advance......

patilamay
Contributor III
Contributor III

Hi 

I think you need to do this 

Sum( sales * price)

HTH

 

Thanks,

qliksus
Specialist II
Specialist II

Since you are just taking the country as a dimension you doing

 

sum(amount)* sum( price) will be   30*5 = 150 

 

sum(amount * price) will be  ( 10*2 + 20*3) =  80 

 

hence try sum(amount * price)  if you are taking just one dimension which is not giving the granular details of each row 

Brett_Bleess
Former Employee
Former Employee

Did either of the posts help you resolve your question?  If so, be sure to return to the thread and use the Accept as Solution button on the post(s) that helped.  This will give credit to the poster and let other Community Members know what worked.  If you still require further assistance, leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.