Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List box - either/or selections?

Hi QlikView gurus - this is probably a simple question.

I have a list box:

I need an option where either "All Lines" can be checked, or any other combination of lines, but not both at the same time. Right now, it's working like this:

This returns very bad data.

Thank you in advance for your help!

1 Solution

Accepted Solutions
sinanozdemir
Specialist III
Specialist III

Hi,

Can you take a look at it now?

Thanks

View solution in original post

9 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

I might have misunderstood your requirements, but here is what I have:

Capture.PNG

Capture2.PNG

You are hiding all other selections and the exp is:

Capture.PNG

Let me know if this is what you are looking for.

Thanks

Not applicable
Author

Thanks, but that wasn't quite working for what I need. I think I need and either / or function so that "All lines" can't be chosen at the same time as any of the other lines, but any combination of other lines can be chosen. "All Lines" is a sum total of the other lines, so if it is chosen along with other lines it returns redundant data.

maxgro
MVP
MVP

try to add a trigger on your field (on select)

Actions    --> Select in field 

Field          -->Line

Search String

='(' & 

if(Alt(SubStringCount(GetFieldSelections(Line, '-'), 'All lines'), 0)

  ,chr(34) & 'All lines' & chr(34),

  chr(34) & GetFieldSelections( Line, chr(34) & '|' & chr(34) ) & chr(34)

  )

& ')'

When you select "All lines" or "All lines" and something else the trigger will select "All lines"

Not applicable
Author

Thank you, but that's not working either. I attached the qvw below. It's the same issue with the "Metric" list box. If "Overall DT %" is chosen, user shouldn't be able to make other selections at the same time.

sinanozdemir
Specialist III
Specialist III

Hi,

Can you take a look at it now?

Thanks

Not applicable
Author

That works great. Thank you!!!

sinanozdemir
Specialist III
Specialist III

You are welcome.

mohan2391
Creator III
Creator III

Hi,

Could you explain the process here. I have personal edition only, can't open your QVW.

Not applicable
Author

Presentation2.jpg

Expression is =If(GetFieldSelections(Line) = 'All Lines', Aggr(Line, Line), Line)