Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a Text & Image box that shows the names of generators when a Site is picked but when there is more than one generator it goes blank. I can't seem to find any way to add a condition to have to pick one type.
Is there a way to do this?
Hi,
Have u tried with FirstSortedValue with distinct function
=FirstSortedValue(distinct Product,-Sales) // Product is dimension and sales is the measure. please update your field
or
=FirstSortedValue(Product,-Sales,1) // in addition u can use Concat function (but the image i haven't test)
P.S: in the above expression instead product u can add the image url
If it's not working can you share the mock data and expected out in excel format. thanks
Thanks,
Deva
Hi Elizabeth, I think you need an extension to set the 'Always' one value selcted option', like:
did you try using concat(fieldname)
Hello,
Yeah that doesn't seem to work either.
Thanks for the info. But that's not going to work, but it's a great extension, thanks for sharing!
Can you share the expression that you are using?
Hello Mark,
RIght now for my Text & Image function I have: ='GENERATOR MODEL'
So when you select a facility the generator that is located there will show in the text box. But when there is more than one generator nothing shows.
Hi Elizabeth, if there are more than one value, qlik returns Null(), represented as a blank value or with a dash.
In Case a funtion returns more than one value you need to tell what to do with this values, like the Concat() funtion pradosh posted:
- Concat([GENERATOR MODEL], ', ') // returns the values separed by commas
- Concat(Distinct [GENERATOR MODEL], ', ') // returns the distinct values separed by commas
There are other options the transform "many values" in the needed "one value":
- MinString([GENERATOR MODEL]) // returns the first value sorted by text
- MaxString([GENERATOR MODEL]) // returns the last value sorted by text