Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
salezian
New Contributor II

Where condition on load statement

Hi everyone

I'm trying to execute following statement:

LOAD DATEID,WORKDAY_IN_MONTH AS WDIM,LAST_WORKDAY_IN_MONTH AS LWDIM

RESIDENT D_DATE WHERE DATEID=date(now(),'YYYY-MM-DD 00:00:00');

But table is empty. Record for today date exists in table. When I change sign = to <= table is loaded with data.

1 Solution

Accepted Solutions
manojkvrajan
Contributor III

Re: Where condition on load statement

Marcin, Please try to declare in a variable and check if it works by using the variable in WHERE condition mentioned below.

LET v_LoadDate = date(now(),'YYYY-MM-DD 00:00:00');

TableA:

LOAD DATEID,

WORKDAY_IN_MONTH AS WDIM,

LAST_WORKDAY_IN_MONTH AS LWDIM

RESIDENT D_DATE

WHERE DATEID='$(v_LoadDate)';

5 Replies
manojkvrajan
Contributor III

Re: Where condition on load statement

Marcin, Please try to declare in a variable and check if it works by using the variable in WHERE condition mentioned below.

LET v_LoadDate = date(now(),'YYYY-MM-DD 00:00:00');

TableA:

LOAD DATEID,

WORKDAY_IN_MONTH AS WDIM,

LAST_WORKDAY_IN_MONTH AS LWDIM

RESIDENT D_DATE

WHERE DATEID='$(v_LoadDate)';

salezian
New Contributor II

Re: Where condition on load statement

It works. Thanks. Can you explain me what is the difference between my solution and yours (except that Yours is working )

Not applicable

Re: Where condition on load statement

Dear Marcin,

Load DATEID as Daystart(DATEID) in your load statement.

Let me know if it works

Mhatim

manojkvrajan
Contributor III

Re: Where condition on load statement

Marcin, WHERE condition considers everything other than number as string. Time stamp will also be considered as string due to the spaces and special characters. Hence it is good to give within single quotes ('') or using a variable in single quotes (''). I hope this helps.

Not applicable

Re: Where condition on load statement

Brilliant post and very helpful.

Community Browser