Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
hammermill21
Creator III
Creator III

Text Box Condition If More than one choice - Qlik Sense

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?

8 Replies
devarasu07
Master II
Master II

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

rubenmarin

Hi Elizabeth, I think you need an extension to set the 'Always' one value selcted option', like:

- Re: Mandatory always one selected value in qliksense

- GitHub - alner/qsSimpleList

pradosh_thakur
Master II
Master II

did you try using concat(fieldname)

Learning never stops.
hammermill21
Creator III
Creator III
Author

Hello,

Yeah that doesn't seem to work either.

hammermill21
Creator III
Creator III
Author

Thanks for the info. But that's not going to work, but it's a great extension, thanks for sharing!

rittermd
Master
Master

Can you share the expression that you are using?

hammermill21
Creator III
Creator III
Author

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.

rubenmarin

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