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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where Statment

Hi,

Trying to set the options for a list box from a table that I have loaded, but seems that i cannot come up with the WHERE clause. The table contains a list of Locations (Centres) and in another column I have a "Delivery" which can either be "InHouse" or "OutSource" so the idea is for ONLY the InHouse centres to be visible, so I have wrote the following:

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where (Delivery) = InHouse;

but when I reload I get the foolowing message:

Field not found - <InHouse>

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where (Delivery) = InHouse

What am I doing wrong?

Any help and All help are very much appreciated.

Thanks in advance,

Labels (1)
1 Solution

Accepted Solutions
kaushiknsolanki
MVP
MVP

Hi,

     Try this.

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where Wildmatch(Delivery,'InHouse');

or

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where Delivery = 'InHouse';

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

9 Replies
kaushiknsolanki
MVP
MVP

Hi,

     Try this.

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where Wildmatch(Delivery,'InHouse');

or

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where Delivery = 'InHouse';

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
salto
Specialist II
Specialist II

Hi,

I would do the next: first load the Excel in a Temporary table and then drop all fields different from InHouse from the temporary table:

Temp_Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre);

Centre:

load * resident Temp_Centre where Delivery ='InHouse';

drop table Temp_Centre;

Hope this helps.

VishalWaghole
Specialist II
Specialist II

Hi Vitor,

Try you where clause like this :

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where  match(Delivery,InHouse)

Thanks and Regards,

Vishal Waghole

Not applicable
Author

Thanks Vishal,

But I think we need to add single quotes (') before and after 'InHouse'... like works perfectly.

Not applicable
Author

Hi Salto,

Will try your solution seems interesting,

Thanks

kalyandg
Partner - Creator III
Partner - Creator III

hi,

try as the below

Centre:

LOAD OrgLocation as Location,

     Centre,

     Delivery,

     Region

FROM

Centres.xlsx

(ooxml, embedded labels, table is Centre)

Where (Delivery) = 'InHouse';

Field values must given in single quote

Thanks,

Kalyan

Not applicable
Author

Hi Kaushik,

Tried your answer and is a great solution.

Thanks,

VishalWaghole
Specialist II
Specialist II

Yes You are exactly right.

I just forgot to add single quotes ('InHouse')

Thanks and Regards,

Vishal Waghole

Not applicable
Author

Thanks Kalyan,

Not sure why didn't worked for me at the first time, as I try this statement before posting on the forum .

Cheers,