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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out 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

Labels (1)
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.