Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create Filter Values from Listbox

Hi,

I have a straight table that shows all my information from a specific database. 

I have created a few list boxes (thanks to this forum) that filters the year and the month separately. 

However I need to create another list box to filter specific data.  In my Database and straight table, there is a column called probcode.  In my list box I want to filter by just Fault or Request. 

However in the probcode column the data shows as such

FLT0-CRPR-CYBR-PSS1

FLT0-CRPR-RCL0-SS00

RQST-RSFT-QLKV

RQST-RSFT-SVRN-NBLL

Basically the first 4 characters will ever only be FLT0 or RQST.  FLT0 meaning Fault and RQST meaning Request. 

Is there way that my listbox can show a tickbox for Fault and a Tickbox for Request, that when ticked it either brings up all the FLT0 or the RQST.

Regards,

Jon Ditchfield

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Ah, ok, try something like:

=if(len(trim(probcode))=0,'BLANK',

pick(

match(left(probcode,4),'FLT0','RQST','NQRY')

,'Fault','Request','Enquiry')

)

View solution in original post

7 Replies
swuehl
MVP
MVP

Try a field expression in your list box like

=if(left(probcode,4)='FLT0', 'Fault','Request')

Not applicable
Author

Hi swuehl,

I have been given wrong information.  Apparently there may be some extra ones that are either blank or start with NQRY.  Is there anyway we can get this into the expression so we have the following

Fault = 'FLT0'

Request = 'RQST'

Enquiry='NQRY'

Blank= 'NULL'

swuehl
MVP
MVP

Just double checked, seems to work on my side. If you say, "brings up the RQST", what do you mean in detail.

I check by creating a list box with above field expression and by creating a list box with field probcode.

If I select either Fault or Request, I only see the correct values in probcode list box selected.

Not applicable
Author

Hi swuehl,

You are correct, its the information I was given,  I have amended my previous update.  Sorry for the incorrect information.

Regards,

Jon

swuehl
MVP
MVP

Ah, ok, try something like:

=if(len(trim(probcode))=0,'BLANK',

pick(

match(left(probcode,4),'FLT0','RQST','NQRY')

,'Fault','Request','Enquiry')

)

Not applicable
Author

Hi Swuehl,

That exactly how I wanted it.  Thanks for the help yet again.

gfisch13
Creator II
Creator II

Hi Stefan - I'm working on a similar procedure.  Using the example above, what if the search values are not in the first 4 characters.   I have a field in my table where values can be up to 50 characters long.

Thanks!

I've created content on my issue if you would like to review:  Keyword Listbox