Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating listbox with SQL Like Statement

Experts,

Currently my scripts as follows

LOAD No,

     PID,

     SDATE,

     TCCODE,

     DESCRIPTION,

     QUANTITY,

     UOM,

     RATE,

     CURRENCY,

     PRICE,

     REPRESENTATIVE

     FROM

(ooxml, embedded labels, table is APR2016 )where DESCRIPTION like '*32*';

    

When I analyse the field values I have values  NODE 44232, DAILY BC 32, MONTHLY BC32, MONTHLY BC-32 etc

I need to query BC 32, BC32, BC-32 only. Like '*32*' is not suitable.

Also instead of putting the statement in Load, I would like to have a listbox (Expression)  with a Single SQL Like statement where user can select.


What is the expression I should use in Listbox?


Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe

LOAD No,

     PID,

     SDATE,

     TCCODE,

     If(Wildmatch(TCCODE,'*BC32*','*BC 32*','BC-32*'),'Find     *BC32* or *BC 32* or *BC-*32') as FindTCCode,

     DESCRIPTION,

     QUANTITY,

     UOM,

     RATE,

     CURRENCY,

     PRICE,

     REPRESENTATIVE

     FROM

(ooxml, embedded labels, table is APR2016 );

Then use FindTCCode in a list box and make the selection to filter.

View solution in original post

12 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

=Aggr(if(Match(TCCODE, 'BC 32', 'BC32', 'BC-32'),TCCODE), TCCODE)

-Rob

ecolomer
Master II
Master II

Try

(ooxml, embedded labels, table is APR2016 )where DESCRIPTION like '*32*' and DESCRIPTION like '*BC*';

MarcoWedel

or maybe

where DESCRIPTION like '*BC*32*';


regards


Marco

Anonymous
Not applicable
Author

Thanks Rob,

My Apologies if I have not made my request clear.

I have  added a list box and in Field I should choose TCCODE or Create an Expression and Enter

=Aggr(if(Match(TCCODE, 'BC 32', 'BC32', 'BC-32'),TCCODE), TCCODE)

-Rob

I tried as follows (Expression) Contains above code you have suggested.

TCCODE.PNG

But What I am looking forward is as follows. A List Box lists specific keywords to search. Upon Selecting this listboxitem,, a Table shows  all fields and TCCODE filed with string matches the selection will be displayed.

findbc32.PNG

Anonymous
Not applicable
Author

Thanks Marco. I do not wish to put this in Load statement. I would prefer to have them listed in a list box. How do I do it?

Anonymous
Not applicable
Author

Thanks Enrique.

I do not wish to put this in Load statement. I would prefer to have them listed in a listbox. How do I do it?

MarcoWedel

Where are the list box values coming from if not loaded?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

In the QlikView UI there is no real SQL-like query langiuage available, but the very powerful Search function offers you much of the same functions and advantages.

Do a search for specific wildcard values in the regular TCODE listbox, and create a bookmark with a proper name. Then create a Bookmarks object and it will show a list of those predefined searches.

Best,

Peter

Anonymous
Not applicable
Author

Go To list box properties  -> instead of selecting Field for LB, write expression ->

If(Description like '*32*', Description)