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: 
Anonymous
Not applicable

Variables in Column Label not working.

Hello All,

I have a dynamic label expression that works when It is dropped as is into a straight table column label like so:

=Date(MonthStart(AddMonths(Max((RDateofPmnt),-11),'YYYY-MM'))

However, when I use variables to store the expression, broken in 2 so I can insert a column specific offset number, it does not

work:

$(=(var1 & '-11' & var2))

I have tried several alternatives but no luck.

When I use a similar tactic for expressions and conditions, it does work.

Just the Label expression does not.

Thanks for any help.

Tim Roy

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Variables containing expressions need to be dollar-expanded:

=$(var1) & '-11' & $(var2)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

But they are not valid expressions until the strings are combined, just pieces

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Oh well, no idea in that case. But try creating a variable with a parameter:

var1: Date(MonthStart(AddMonths(Max((RDateofPmnt),$1),'YYYY-MM'))


label: =$(var1(-11))


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thanks for the idea, that works.

I still wonder why it didn't work the other way.

I worked for Expressions and Conditions, just not Labels

Anyways, onward ..... and

Regards