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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
wgonzalez
Partner - Creator
Partner - Creator

Replacing an expresion with a Expansion using Variable

Hi,

I want to replace this long expresion NetWorkDays(MonthStart(min(DTPunchDate)),MonthEnd(max(DTPunchDate))))

with an Expansion Variable.  The intention is to simplify the expresion in the chart.

Have anyone done this before?  How?

Thanks,

Wilfredo.

1 Solution

Accepted Solutions
wgonzalez
Partner - Creator
Partner - Creator
Author

Nice!  It worked, Thanks!

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes, simply create th variable and store the formula there as a text. If you decide to use it in the load script, use SET statement rather than LET.

Then, in the chart, simply recall the variable using $-sign expansion:

SET vFormula ='NetWorkDays(MonthStart(min(DTPunchDate)),MonthEnd(max(DTPunchDate))))';

Expression:

$(vFormula)

cheers,

Oleg

Ask me about Qlik Sense Expert Class!
wgonzalez
Partner - Creator
Partner - Creator
Author

Nice!  It worked, Thanks!