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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SetAnalysis and Aggr


Hi,

This is my Dimension

DeliveryDocument_Key

These are my expressions

1st expression:

sum(Aggr((Sum(DeliveryQuantity/[ST/KAR1])/ sum(OrderQuantity/[ST/KAR]))* Range,DeliveryDocument_Key))

2nd expression

Sum(DeliveryQuantity/[ST/KAR1])

Now these two work..

what I need is  1st expression * (2nd expression pro DeliveryDocument_Key)

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

                       Sum(Total 2nd Expression)

I wrote

=sum(Aggr((Sum(DeliveryQuantity/[ST/KAR1])/ sum(OrderQuantity/[ST/KAR]))* Range,DeliveryDocument_Key))Sum(Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))/ Sum(TOTAL Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))

which does not give the result. How should I write?

Thanks

Sravan

1 Solution

Accepted Solutions
Not applicable
Author

Hi Erika,

The basic trick in setanalysis is to test the parts individually, which I did not do before.

This did the trick after individually checking the parts and adding AVG

=AVG(Aggr((Sum(DeliveryQuantity/[ST/KAR1])/ sum(OrderQuantity/[ST/KAR]))* Range,DeliveryDocument_Key)) *  Sum(Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))/ Sum(TOTAL Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))

Thanks anyway

Regards

Sravan

View solution in original post

2 Replies
Not applicable
Author

Try this:

=(((sum(Aggr((Sum(DeliveryQuantity/[ST/KAR1])/ sum(OrderQuantity/[ST/KAR]))* Range,DeliveryDocument_Key)) )*  (Sum(Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))))/ Sum(TOTAL Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key)))

else upload ur application...

Not applicable
Author

Hi Erika,

The basic trick in setanalysis is to test the parts individually, which I did not do before.

This did the trick after individually checking the parts and adding AVG

=AVG(Aggr((Sum(DeliveryQuantity/[ST/KAR1])/ sum(OrderQuantity/[ST/KAR]))* Range,DeliveryDocument_Key)) *  Sum(Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))/ Sum(TOTAL Aggr(Sum(DeliveryQuantity/[ST/KAR1]),DeliveryDocument_Key))

Thanks anyway

Regards

Sravan