Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mdesilvaCC
Contributor II
Contributor II

Multiplying Column values from Different rows and then Summing the results

Hi

Im trying to see whether it possible to multiply two different columns from different rows (dimension Values) and then Sum the product. There are examples of using Set Analysis on the same row across columns or different rows  summed individually and then multiplying but not as per the below example

 

mdesilvaCC_0-1708060088694.png

 

so I want to calculate       (Dim1=C , Dim2=BB  Value1 ) *   (Dim1=A ,Dim2=AA  Value2 ) And Then Sum the product of it.

So something like this

SUM(   (Dim1=C , Dim2=BB  Value1 ) *   (Dim1=A ,Dim2=AA  Value2 ) )

The issue I have i am unable to construct the set analysis as the aggregation is after picking up Value 1 and Value 2 from rows. Any help would be greatly appreciated

Qlik Sense Business 

 

Labels (4)
2 Replies
Vegar
MVP
MVP

You can use set analysis to construct your calculation. 

Try this 

Sum({<Dim1={'C'}, Dim2={'BB'}>}Value1)*Sum({<Dim1={'A'} ,Dim2={'AA'}>}Value2)

Or try this

Sum({<Dim1={'C'}, Dim2={'BB'}>}total Value1)*Sum({<Dim1={'A'} ,Dim2={'AA'}>}total Value2)

mdesilvaCC
Contributor II
Contributor II
Author

Hi @Vegar  thanks for your reply,

I have tried your suggestion however the result is the product of two sums (Value 1) *SUM( Value2) rather than the Sum of products SUM(Value1* Value2) which is what Im trying to achieve.