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

QlikView Variable Expansion in set expression

HI All,

I have a variable that calculated correctly and I verified it using a text box.

I want to use the value of this variable in the below set expression:

='$'&NUM(ROUND(SUM({$<calendar_date_num = , business_date_num = {'$(=vMaxBusinessDate)'}>} '$(=vDerivedName)'),'###,###,###,###')

OR

='$'&NUM(ROUND(SUM({$<calendar_date_num = , business_date_num = {'$(=vMaxBusinessDate)'}>} {<$(=vDerivedName)>}),'###,###,###,###')

To explain it in other words, what I am trying to do is in a set expression like SUM({<Year=2007>}sales), I am trying to dynamically change the 'sales' field based on the value of a variable. Would be great is someone can help me on this issue. Am I messing up with syntax?

Thanks

Raghu

1 Solution

Accepted Solutions
Not applicable
Author

If vDerivedName evaluates to a field name then use SUM({$<calendar_date_num = , business_date_num = {'$(=vMaxBusinessDate)'}>} $(=vDerivedName))

View solution in original post

2 Replies
Not applicable
Author

If vDerivedName evaluates to a field name then use SUM({$<calendar_date_num = , business_date_num = {'$(=vMaxBusinessDate)'}>} $(=vDerivedName))

Not applicable
Author

Hey..thanks.

I was able to figure out the solution. And its exactly the same as you mentioned above. I was also missing a date format.

Thanks

Raghu