- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
returning multiple values using Only() function
Hello everyone,
I have a chart where I'm using set analysis with an alternate state to return values based on 'metric labels'.
My issue is coming from when a user has multiple values in for one metric and I need to show both.
My current expressions looks like this:
only({<[Metric Label]={'Metric1'}>}Detail_Field)
only({<[Metric Label]={'Metric2'}>}Detail_Field)
only({<[Metric Label]={'Metric3'}>}Detail_Field)
To illustrate:
I'm currently using the Only() function to return the values per metric per user. When there are 2 values for a metric, it returns a null value:
User ID | Metric1 | Metric2 | Metric3 |
---|---|---|---|
001 | - | Metric2Detail | Metric3Detail |
When I remove the only() function, this is what I get:
User ID | Metric1 | Metric2 | Metric3 |
---|---|---|---|
001 | - | Metric2Detail | Metric3Detail |
001 | Metric1Detail1 | - | |
001 | Metric1Detail2 | - |
So you can see, I have 2 details in Metric 1, but since Qlikview doesn't know what value to use under the Only() function, it returns a null value.
What I'm trying to get is a single row per user. If there are 2 details within a metric, I want them to all be within the same cell.
User ID | Metric1 | Metric2 | Metric3 |
---|---|---|---|
001 | Metric1Detail1 Metric1Detail2 | Metric2Detail | Metric3Detail |
Is this 3rd table achievable?
Thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try this:
concat({DISTINCT <[Metric Label]={'Metric1'}>}Detail_Field,CHR(13))