Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
Can anyone explain the following expression please. It's being used as a conditional expression to show fields in a Pivot table.
Index('|'&concat(%FieldsFresh,'|')&'|', '|Fresh/Frozen|')
and
Len(GetFieldSelections(%FieldsFresh))>0
Thanks
Kieron
It is trying to enable the dimension field when the dimension name is selected from a list box.
Index('|'&concat(%FieldsFresh,'|')&'|', '|Fresh/Frozen|') --- it gives the field number with in the concat string
and
Len(GetFieldSelections(%FieldsFresh))>0 -- this is to make sure atleast one selection is made
you could write
substringcount(concat(%FieldsFresh,'|'), 'Fresh/Frozen')
and
Len(GetFieldSelections(%FieldsFresh))>0
Thanks SC
Appreciate your help.
It makes more sense now.
To further explain why the inital and final '|'.
Imagine you have this values: "Car" and "Caravan". With these values if the user selects "Caravan" and you don't have the starting and ending '|', the filter expression for "Car" also it's true, as the word "Caravan" contains "Car".
With the starting and ending '|', "|Car|" and "|Caravan|" only will be found when you select that exact values.
Thanks RubenMarin,
I didn't know that yet.
So the '|' helps to fins only exact matches.
That's good to know
Ruben you are right. i usually have a associated field in my dimension table (island table) like DimIdentifier field values A, B, C... to avoid those issues .
substringcount(concat({<DimIdentifier ={'A'}>}%FieldsFresh,'|'), 'Fresh/Frozen')
and
Len(GetFieldSelections(%FieldsFresh))>0