Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Contributor

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
Highlighted
Contributor

Re: Expression issue in aggregation

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......

Highlighted
Contributor

Re: Expression issue in aggregation

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......

Highlighted
New Contributor III

Re: Expression issue in aggregation

Hi 

I think you need to do this 

Sum( sales * price)

HTH

 

Thanks,

Highlighted
Valued Contributor II

Re: Expression issue in aggregation

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 

Highlighted
Digital Support
Digital Support

Re: Expression issue in aggregation

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.