Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'd have a Field YearQtr with Quarters in it from 2019Q1 and on.
If I select 4 Quarters in a field named YearQtr as follows 2021Q2, 2021Q3, 2022Q2, 2022Q3
I'd like to Dynamically perform Set Analysis on the Array of these selections.
So instead of defining the Quarters via Set Analysis like this Sum({$<YearQtr={'2021Q2'}>}NetSales)
I'd like it to Dynamically program the SetAnalysis like this
Sum({$<YearQtr={ Array Filter Position 1 }>}NetSales)
Sum({$<YearQtr={ Array Filter Position 2 }>}NetSales)
Sum({$<YearQtr={ Array Filter Position 3 }>}NetSales)
Sum({$<YearQtr={ Array Filter Position 4 }>}NetSales)
I feel like this could be possible but haven't stumbled on either a way or another post where I can find the right keywords to find it.
Thanks!
Hello,
Will you have one formula for each value of quater ?
I'm thinking of using a variable which will contained the values selected on the field Quater. In order to choose the first one, the second one ... you may use the function subfield.
@brooksc57 where would you use these individual set expression? could you elaborate more on your requirement?
Hello,
Will you have one formula for each value of quater ?
I'm thinking of using a variable which will contained the values selected on the field Quater. In order to choose the first one, the second one ... you may use the function subfield.
refer this article
https://community.qlik.com/t5/Member-Articles/Period-Presets-Compare-Periods-on-the-fly/ta-p/1486371
Hi VP, that is a cool qvw. I am building a straight table so that it can sort easy, but that is a really nice 'app' for sure.
That is similar to what I was thinking. Both taking a night off from looking at it and also reading your thread has me there or very close at least.
The 1st Period would be something like this in a variable.
I imagine I could wrap that is some SetAnalysis as well but this will do.
=if(GetSelectedCount(YearMonth,False(),'Period1')>0,
Subfield(Concat({Period1}Distinct YearMonth,';'),';',1),
if(GetSelectedCount(YearQtr,False(),'Period1')>0,
Subfield(Concat({Period1}Distinct YearQtr,';'),';',1),
Subfield(Concat({Period1}Distinct Year,';'),';',1)
))