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: 
jadams123
Creator
Creator

Question

Hi All:

I want to be able to do this statement:

1) if max week -1 is between weeks 40 to 44 then P10.

This is my formula for max(Week -1):

=Sum( {$<YEAR = {$(#=Max(YEAR))}, [Week No]= {$(#=Max([Week No])-1)}, CUSTOMER_TYPE -= {ITC}, CREDIT_CODE = {YES}>} AMOUNT )

This is my formula for max(period):

=Sum( {$<GLYEAR = {$(#=Max(GLYEAR))}, GLPERIOD= {$(#=Max(GLPERIOD))}, CUSTOMER_TYPE -= {ITC}, CREDIT_CODE = {YES}>} AMOUNT )

Thanks,

J

11 Replies
jadams123
Creator
Creator
Author

My IT dept told me that in order for this code to work I have to select 2017 and weeks 1-XX. And its working.

Its not the perfect code...but it is working.

vinieme12
Champion III
Champion III

Then try MAx with the TOTAL keyword

Sum( {$<YEAR = {$(=Max(TOTAL YEAR))}, [Week No]= {"<=$(=Max(TOTAL [Week No])-1)"}, CUSTOMER_TYPE -= {ITC}, CREDIT_CODE = {YES}>} AMOUNT ).

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.