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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Variable help

Hi all,

i have the following variable..

='>='&CurrentPeriod&'<='&Only({<Counter = {$(=Only({<PERIOD = {$(=Only(CurrentPeriod))}>}Counter)+12)}>} PERIOD)

which this is used in an action or trigger it makes selections on 13 periods (current and next 12).

i am trying to get the 13 period values to display in a text box but i can't seem to get it working.

Can anyone help?

4 Replies
tresesco
MVP
MVP

May be like this?

Concat(Distinct {<Counter = {$(=Only({<PERIOD = {$(=Only(CurrentPeriod))}>}Counter)+12)}>} PERIOD, ',')

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks for the reply.

the current period is 201708

so what i want is a text box that gives me..

201708

201709

201710

201711

201712

201801

201802

201803

201804

201805

201806

201807

201808

what you have suggested only gives me the last period (201808).

wouldn't i still have to use the >=currentperiod<= currentperiod+12?

tresesco
MVP
MVP

This?

Concat(Distinct {<PERIOD= {'>=$(=Max(PERIOD)) <$(=Max(PERIOD)+12)'}>} PERIOD, ',')

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

no that gives me the max period in my dataset which is 203206.

I have attached an example.

there is a button that selects the periods needed. i am using a counter field which is against the Period field to make the correct selections (as 201708+12 is 201720 which is not the correct period.

the button works, but i want a text box showing the periods instead of the button.

This is for NPrinting btw, the variable that works in the button doesnt work in NPrinting, so i am trying to get a variable to evaluate the periods needed separated by a pipe then i'm going to try and get NPrinting to apply the pipe separated values to the field.

I hope that make sense..