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

Need to add a max to if statement inside of sum

Anyone know a way to get this to work?

sum(

if([First Order Year]=

if(isnull(GetFieldSelections([Year Ordered])),

year(today()),

Max([Year Ordered])),

([Release Qty]*[Orderdtl Unit Price])))

I only want the sum to happen if the year ordered is equal to the max selected value.

So if they select 2012 it is 2012. If there select 2011 and 2012 it is still 2012.

2 Replies
sivarajs
Specialist II
Specialist II

try this

sum(if([First Order Year]=Max([Year Ordered]),[Release Qty]*[Orderdtl Unit Price])))

Not applicable
Author

This returns an error in expression, with no value returned.

I guess I can just do it with set analysis. Not sure why I did not do that in the first place