Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
I have a field called "_Dimensions" which I use to select different measure fields with the "always one selected value" option.
In a variable I have if-statements to call the sum function.
This is the original version:
if(SubStringCount(Concat(_Dimensions, '|'), 'This is A'), sum([This_Is_Field_A]),
if(SubStringCount(Concat(_Dimensions, '|'), 'This is B'), sum([This_Is_Field_B]),
if(SubStringCount(Concat(_Dimensions, '|'), 'This is C'), sum([This_Is_Field_C]),Null()
)))
I can use this in a "normal" expression, however now I want to be able to write something like this:
=sum({$<[MyDimension]={"SomeFilter"}>} GetFieldSelections(_Dimensions))
So that I can grab the currently selected text in the _Dimensions field dynamically and use it in the sum function.
Also note that above field names and selection strings a written differently.
Do you know what I need to do to get this right?
Thank you.
You could do something like this:
=sum({$<[MyDimension]={"SomeFilter"}>} [$(=GetFieldSelections(_Dimensions))])
- Marcus
You could do something like this:
=sum({$<[MyDimension]={"SomeFilter"}>} [$(=GetFieldSelections(_Dimensions))])
- Marcus