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: 
Pratik81
Contributor II
Contributor II

Comparing a Measure and a dimension and selecting the max value

Hi All, 

I am relatively new to qlik and i have a situation where i want to compare  Sum of Qty with Target set and select the max incentive for the the corresponding value. Incentive achieved is the Max incentive * Sum of Qty. 

Would greatly appreciate some help here. 

Thank you

 

Customer Sum of Qty  Tier Target Qty Incentive Incentive Achieved 
Customer A 90 50 10  
Customer A 90 60 20  
Customer A 90 80 30 2700
Customer B 30 20 10  
Customer B 30 30 20 600
Customer B 30 40 30  
Labels (2)
4 Replies
mpc
Partner Ambassador
Partner Ambassador

Hi,

Maybe you can use Max(total Incentive) ? It will ignore Customer dim and take the Max for all the table

Best

From Next Decision and mpc with love
Pratik81
Contributor II
Contributor II
Author

Thanks for your response. I think if i do the Max(total Incentive) then it will always provide one value that is 30 which is max incentive in the table.

However this might not be case as can be seen for customer B where the Sum of Qty achieved (30) is lower than the Tier Target Qty (40) which does not qualifies the customer B for Incentive (30)

Hence the customer does not qualify for the incentive (30) but qualifies for the tier lower which is (20). Hence what i am trying to achieve in the table in a measure (Incentive Achieved) that calculates the total incentive recieved by Customer B as 30* 20= 600

mpc
Partner Ambassador
Partner Ambassador

Quite more complex indeed. 
At glance I think you can achieve this Aggr function. I'll test it by myself and send you a QVF. 

Best

From Next Decision and mpc with love
Pratik81
Contributor II
Contributor II
Author

Would really appreacite that. Thanks for looking into it.