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?
Have u tried with FirstSortedValue with distinct function
=FirstSortedValue(distinct Product,-Sales) // Product is dimension and sales is the measure. please update your field
=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
Hi Elizabeth, I think you need an extension to set the 'Always' one value selcted option', like:
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