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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to nest an expression to avoid the use of a variable?

Hi

I would like to be able to determine the most recent non blank value of a field. Currently I can do this by creating a variable eg.

vUsedC=Max({<[Used C]={*},Month>} Month) 

then using this variable in an expression

=sum({<Month={"$(vUsedC)"}>} [Used C])

Rather than create and retain many many many variables to do this in my project, I would like to combine the two expressions something like

=sum({<Month={'Max({<[Used C]={*},Month>} Month)'}>} [Used C])

Unfortunately this is not working and I have not yet determined the placement of TOTAL that might provide the solution. Once again, any assistance would be appreciated.

Thanks

Brian

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

sum({<Month={'$(=Max({<[Used A]={*},Month=>} Month))'}>} [Used A])

Follow same for other 2 expressions.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

sum({<Month={'$(=Max({<[Used A]={*},Month=>} Month))'}>} [Used A])

Follow same for other 2 expressions.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anil_Babu_Samineni

Perhaps this?

=sum({<Month={"$(=Max({<[Used C]={*},Month>} Month))"}>} [Used C])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thank you Kaushik and Anil.