Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello experts,
I need to lock a value in a set analysis and maintain that selection in spite of other selections being made by the same dimension. Let me explain briefly:
I need to lock a region, for instance NYC. So I go:
But, the user can also select other Region, like LA. What I want is to lock NYC and maintain its value, whether the user selects other region.
I tried with no success:
Thanks in advance!
I am not sure exactly what you want. If you want to ignore selections from all fields, and have Region ='NYC' and ID=1, then
should work. If it is not, can you provide an example where you do not get what you want?
sum({<Region={'NYC'}>}Sales) will always display sales for NYC, regardless of selections made in the Region field. Note that other selections can impact this - for example, if you select Country = Canada, this expression would presumably return 0 since there are no rows for Region = NYC and Country = Canada.
Thanks @Or . What about if i select another value from another dimension on the set analysis, but i still want to show the values for NYC regardless of any other selections made by the user.
A sample table:
ID, Region, Sales
1, NYC, 123
2, NYC, 321
1, Canada, 258
2, Canada, 852
i want to show the first row regardless of any selection made by the user, so I tried locking the Region dimensions like, with no success:
sum({<ID={'1'}, Region={'NYC'}, Region>}Sales)
Any suggests?
i believe this is what you may be looking for
sum({<Region+={'NYC'}>}Sales)
+= will add "NYC' to any selection,
example
1) if Nothing is selected = Shows DATA for ALL REGIONS
2) if Canada is selected = SHOWS DATA for CANADA + NYC
If you would like to add NYC to any selection made, use Region+={'NYC}. By default this will show all values (when no selections are made).
If you would like to display NYC only by default, and if a selection is made, only show that selection + NYC, I typically use something along the lines of:
If(GetSelectedCount(Region)>0,sum({<ID={'1'}, Region+={'NYC'}, Region>}Sales), sum({<ID={'1'}, Region={'NYC'}, Region>}Sales))
I am not sure exactly what you want. If you want to ignore selections from all fields, and have Region ='NYC' and ID=1, then
should work. If it is not, can you provide an example where you do not get what you want?
Thanks Elin, putting the 1 at the start of the Set Analysis locks the selections made in the SA.
I wasn't having any results due a missing mapping in the region field.