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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

filter results in load statement

Hi, I'm new to Qlik, I am trying to filter out order type to only those coded as "O"

Seems logical to me that I could simply place in the load

"ord_type"='O'

But this does not seem to work, my results are pulling in O and Q type orders

I also tried "ord_type" like 'O'

Still no go

11 Replies
sunny_talwar

Try this may be:

Order_Header:

LOAD yourListofFields,

          ...

Where MixMatch(order_type, 'O');

SQL SELECT *

FROM ...

ramoncova06
Partner - Specialist III
Partner - Specialist III

what results do you get by doing this in the db ?

Not applicable
Author

Still not working, but this this raises another question;

Placement of the where statement? If I place this at the bottom of the fields loaded but before the SQL Select the "Where statement turns red and doesn't seem to be an active function any longer, it turns blue if placed after the field but shows error in script editor.

Not applicable
Author

Not sure I understand the question, If I run an access query against the dbase I can easily filter out "Q" type orders with a field criteria of Like "O"

If I run SQL query same thing

Does Qlik use the same like or = functions as SQL? Also what does Qlik use for wildcard? * %

sunny_talwar

You did not put the Where statement at the right place:

Order_Header:

LOAD "ord_type",

          "ord_dt" as OrderDate,

          Month("ord_dt") as Month,

          Year("ord_dt") as Year,

          "oe_po_no",

          "user_def_fld_3" as Order_Code,

          "cus_no",

          "bill_to_name",

          "ship_to_name",

          "ship_to_addr_1",

          "ship_to_addr_4",

          "slspsn_no"

Where MixMatch ("ord_type", 'O');

SQL SELECT *

FROM "100".dbo."oeordhdr_sql";

Not applicable
Author

I did place the where statement as you show, like said, when doing this the where turns red and doesn't seem to be an active function.

Here is the script and the error.

sunny_talwar

There is no comma (,) after "slspsn_no"

  "slspsn_no"

Where MixMatch ("ord_type", 'O');

Not applicable
Author

I see now, sorry for the confusion. Works great.

Thank you so much!

sunny_talwar

Not a problem