Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ValueList

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!

Labels (1)
4 Replies
sunny_talwar
MVP
MVP

May be you need this:

If(GetSelectedCount(_metricsNo) > 0, Pick(_metricsNo, 'Pr', 'Be', 'LR'))

sunny_talwar
MVP
MVP

If this is not what you need, would you be able to share a sample with your expected output?

Not applicable
Author

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'

swuehl
Champion III
Champion III

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))

)