Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Grouping a field and displaying customized names in a listbox

Hi, I am trying to create a filter based on the requirement in a listbox. For ex. FieldName is Status (Id column) and has 10 values from 1 to 10.

Status

1

2

3

4

5

6

7

8

9

10.

So, i want to create a filter like

if Status = 10, 'Completed'

if Status <> 9 and Status <> 10, 'Open'

finally, 'Any' for all values of Status. My list box will look like as in the attachment.

I have used below if condition, but its not working as I expected. First two conditions were fine, but for 3rd condition ('Any'), instead of all values, its showing only value '9'.

Any help will be greatly appreciated and thanks in advance for your hlep.

1 Solution

Accepted Solutions
Highlighted
Not applicable

I achieved this task by adding each button for each selection and then used container to group all the 3 buttons. Also, I created a variable to change the color of the button once you selected. Any ways, thank you all for your wonderful suggestions and time.Listbox1.png

View solution in original post

9 Replies
Highlighted
MVP & Luminary
MVP & Luminary

I'd recommend to solve it in the Data Model and load the Status Descriptions associated with the Status numbers.

In a calculated formula, you can only assign one Name per number. In order to associate all statuses with the name 'Any', it's best to create a data table.

Cheers,

Oleg Troyansky

Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Milan, Italy!

Oleg Troyansky

Masters Summit for Qlik is going virtual! Nov 18th - I'll teach Advanced Set Analysis and AGGR

Highlighted
Not applicable

Hi Oleg, Thanks for the suggestion. But, could you please explain in more details how can I achieve that. I would like to do it in front end than in back end. So, please suggest me.

Highlighted
MVP & Luminary
MVP & Luminary

My point was that you cannot do it in the front end, only in back end - because you need to associate multiple names with the same number.

Oleg Troyansky

Masters Summit for Qlik is going virtual! Nov 18th - I'll teach Advanced Set Analysis and AGGR

Highlighted
MVP
MVP

Source:

load * inline [

S

1

2

3

4

5

6

7

8

9

10

];

load S, 'Any' as Status Resident Source;

load S, if(S=10, 'Completed') as Status Resident Source;

load S, if(not match(S, 9,10), 'Open') as Status Resident Source;

1.png

Highlighted
Master
Master

Hi,

There you are mentioning clearly the conditions like that right ,

Status 10 completed

Status with out 9 and 10  open , Means 1- 8 are OPEN

Lastly  remaining Status code is 9 right that is treated as Any

If(Status<>9 and Status<>10,'Open',If(Status=10,'Completed',If(Status=Status,'Any')))as FilterStatus

HTH,

HirisH

HirisH
“Aspire to Inspire before we Expire!”
Highlighted
Not applicable

Hi MG, Thanks for your help. However it did not work. In the example you mentioned above, if you select 'Open' in Status, all the values from 1 to 8 should be highlighted in GREEN. Similarly for other options as well. If I select 'Any', all the values of S should be highlighted in GREEN.

Highlighted
Not applicable

Hi Hivish, I tried your solution too, but it dint work either. I believe that Oleg is correct and I can not do it in front end. Instead of Listbox, I am thinking to use a button for each selection. I will try that approach and will post here. But, if anyone has solution for this, please share with me.

Highlighted
MVP
MVP

try adding a trigger on the Status field

Highlighted
Not applicable

I achieved this task by adding each button for each selection and then used container to group all the 3 buttons. Also, I created a variable to change the color of the button once you selected. Any ways, thank you all for your wonderful suggestions and time.Listbox1.png

View solution in original post