Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Extract fields from GetFieldSelections

I have [Month] as a filter. I want to be able to select certain months at a random order and run a part of a code for those Months alone.

if(GetSelectedCount([Change])=1 and GetSelectedCount(Month)=1 ,

        if(avg(TransitionMonthNum)>=num(Month),

                Rangesum(above(total(sum({<Version={'1YP'}>}Value)),0,rowno(total)))

              + sum(total {<TransitionMonth={'$(=getfieldselections(Month))'} , Version={'1YP'}>}Value)*[Change]/100,

                Rangesum(above(total(sum({<Version={'1YP'}>}Value)),0,rowno(total)))

                )

              )


The above code works when only one [Month] is selected. I want this to run when GetSelectedCount(Month)>1 and have the values from GetFieldSelections(Month) in an array or something, and then create a loop, so that the code works for all the months selected.

What would be the best way to do this?


14 Replies
Anonymous
Not applicable
Author

The Output I have now is something like this:

Projections.PNG

I want to be able to do this for multiple Months.

stalwar1‌ It's very sensitive data and I have to de-sensitize it before I can send it to you. Let me know if the image helps at all.

Thanks.

sunny_talwar

When you say that you want to do this for multiple months, what exactly do you mean? See more than 7 months you see now?

Anonymous
Not applicable
Author

No, I will still see 7 months. In the graph above, the line starts diverging in Aug because that's the filter I have selected. The [Value] for Aug decreases by 20%. If I want to know what happens if we change [Value] by 20% for both Aug and Sep, the graph should be able to show that.

sunny_talwar

So, this is starting to make a lot more sense. What happens when you select 2 months without any changes? Errors out? incorrect result?

Anonymous
Not applicable
Author

It displays nothing.