Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to create a conditional valuelist dimension. There is an error in my expression but the program does not indicate where. What is wrong?
//SubStringCount(Concat(_metricsNo, '|'), 1) outputs the number 1- I have tested this.
=ValueList(If(SubStringCount(Concat(_metricsNo, '|'), 1)=1,'Pr'),
If(SubStringCount(Concat(_metricsNo, '|'), 2),=1'Be'),
If(SubStringCount(Concat(_metricsNo, '|'), 3)=1,'LR'))
Thank you!
May be you need this:
If(GetSelectedCount(_metricsNo) > 0, Pick(_metricsNo, 'Pr', 'Be', 'LR'))
If this is not what you need, would you be able to share a sample with your expected output?
This is the relevant script.
Metrics:
LOAD * INLINE [_metricsNo, _metrics
1, Pr
2, Be
3, LR
If _metricNo 1 field is selected, the value list should include the string 'Pr'
I am not quite sure what you are trying to achieve, ,maybe just use _metrics as dimension?
Or
=ValueList(
$(=chr(39)&Concat(DISTINCT _metrics, Chr(39)&','&chr(39), _metricsNo) &chr(39))
)