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

Set Analysis with Variable

I have created a variable vDateMax = num(max(TNA_DATE)) to return the max date of date range selected.

I would like a text object to display the sum of ASSETS where TNA_DATE=vDateMax. This is my expression:

=Num(sum({$<TNA_DATE={$(vDateMax)},CONSULTANT_FIRM_ID={*}>} ASSET_ACCOUNT_TNA),'$ #,##0')

Can anyone help; I'm getting "Error in set modifier ad hoc element list: ',' or ')' expected"

12 Replies
Colin-Albert
Partner - Champion
Partner - Champion

Try this, you need to format the variable not the field being compared.

=Num(sum({$ <TNA_DATE={" $(= date($(vDateMax),'MM/DD/YYYY,)"}, CONSULTANT_FIRM_ID= >} ASSET_ACCOUNT_TNA),'$ #,##0')

Not applicable
Author

Figured it out finally. Gave up on using the on-the-fly variable (vDateMax), and used the existing column TNA_DATE instead

=num(Sum({$<CONSULTANT_FIRM_ID={*},TNA_DATE={$(=max(TNA_DATE))}>}ASSET_ACCOUNT_TNA),'$ #,##0')

Not applicable
Author

thank you - i already use this site all the time