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

How to write WHERE clause

Hi,

Could anyone help me in this.

I have a column Queue with data quality,regionalexception,divisionreveiew,nationdept,sales and another column Department with data hr,manager,accounts,ceo.

i need to consider both columns Queue and Department having regionalexception,divisionreveiew in Queue and hr,manager in Department.

Could anyone help me how to write WHERE clause.

Thanks.

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

Load * from tablename

Where wildmatch(Queue,'regionalexception','divisionreveiew') and Wildmatch(Department,'hr','manager');

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

6 Replies
MayilVahanan

Hi

Try like this

Load * from tablename

Where wildmatch(Queue,'regionalexception','divisionreveiew') and Wildmatch(Department,'hr','manager');

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi,

Thanks for your answer it helped me and I have column When which contains date. Could you please help me how to create calendar by using this field?

Thanks

MayilVahanan

Hi

Load

*,

Year(DateField) as Year,

Month(DateField) as Month,

Week(DateField) as Week,

Day(DateField) as Day,

'Q'&Ceil(Month(DateField)/3) as Quarter,

Date(DateField) as Date

From Tablename;

Here DateField is When

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi

Thanks for your answer and Could I know Do I need to create Master Calendar? That means how can I get Month JAN-DEC and Year as 2013-2014,2014-2015,2015-2016 and so on and Quarter as Q1,Q2,Q3,Q4

Thanks.

MayilVahanan

HI

//Get Minimum date from table

TempDateMin:

LOAD

          Min(DateNum) AS MinDateNum

RESIDENT TableName;

//Get and store Minimum devlivery date

LET vDateMin = FieldValue('MinDateNum', 1);

LET vDateMax = Floor(Num(Today()));

DROP TABLE TempDateMin;

MasterCalendar:

LOAD

          DateNum,

          Year(DateNum) AS "Calendar Year",

          Month(DateNum) & '-' & DATE(DateNum,'YY') as "Calendar Month Year",

          Month(DateNum) as "Calendar Month",

          Day(DateNum) * 1 as "Calendar Day",

          Week(DateNum) * 1 as "Calendar Week",

          WeekDay(DateNum) * 1 as "CalendarWeekDay",

          Round(DateNum) as DateLink,

          'Q' & Ceil(Month(DateNum) / 3) AS "Calendar Quarter";

LOAD

          ($(vDateMin) + (RecNo()-1))  AS DateNum

AUTOGENERATE ($(vDateMax ) - $(vDateMin) + 1);

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
MayilVahanan

Hi

For master calendar,

Please refer

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar

Hope you can understand it

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.