Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Between two date in Where Clause Load script

Hi,

I have create load script like below:

Date:

LOAD

   Min(CREATED_DATE)     as FirstDay,

   Max(CREATED_DATE)     as Today,

   Max(CREATED_DATE)-30  as Last30,

   Max(CREATED_DATE)-60  as Last60,

   Max(CREATED_DATE)-90  as Last90,

   Max(CREATED_DATE)-120 as Last120

RESIDENT Sales;

LET v_FirstDay = Date(peek('FirstDay',0,'Date'),'YYYY-MM-DD');

LET v_today   = Date(peek('Today',0,'Date'),'YYYY-MM-DD');

LET v_Last30  = Date(peek('Last30',0,'Date'),'YYYY-MM-DD');

LET v_Last60  = Date(peek('Last60',0,'Date'),'YYYY-MM-DD');

LET v_Last90  = Date(peek('Last90',0,'Date'),'YYYY-MM-DD');

LET v_Last120 = Date(peek('Last120',0,'Date'),'YYYY-MM-DD');

DROP TABLE Date;

Between Date doesn't works anymore:

Cohort:

LOAD

    CREATED_DATE as CREATED_DATE1,

    CUSTOMER_EMAIL as Email,

    ITEM_STATUS as ITEM_STATUSS,

    ORDER_STATUS as ORDER_STATUSs

RESIDENT Sales

Where CREATED_DATE >= Date#('$(v_Last30h)', 'YYYY-MM-DD') and  CREATED_DATE <= Date#('$(v_today)', 'YYYY-MM-DD');

could you please advise me ?

Best,

Robert

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

You used v_Last30h in where, but your Let has different variable name

LET v_Last30  = Date(peek('Last30',0,'Date'),'YYYY-MM-DD');

View solution in original post

2 Replies
anbu1984
Master III
Master III

You used v_Last30h in where, but your Let has different variable name

LET v_Last30  = Date(peek('Last30',0,'Date'),'YYYY-MM-DD');

Not applicable
Author

oops ... Thanks anbu.