Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Dynamic ValueList using GetFieldSelections


(fairly new to Qlik)

I am trying to create a dynamic valuelist for a chart that needs to only display the current and prior 2 x Periods based on the current selected Period. My Period is based on date parameters, but are not calendar months starting on the 1st and ending on the last day of the month, so this gets calculated in another imported table.

I have added this as a dimension and it works great:


I have used this as my Measure expression:


I only get a result for my selected period, yet if I replace ... sum(if([Period]=getfieldselections(Period)-2,StockTotalExc) ... with the actual values as a non-variable throughout, I get it to work perfectly.

Any ideas?

1 Reply

Re: Dynamic ValueList using GetFieldSelections

Why do you need ValueList() function here? Have you tried using something like this:

Dimension: Period

Expression: Sum({<[Period] = {"$(='>=' & (Max(Period) - 2) & '<=' & 'Max(Period))"}>} StockTotalExc)

Community Browser