Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

date issue

I have in my data load script has a date field (T_DATE) . I have modified this in the follwing way

      IF(POL_TYPE='F',T_DATE) AS C_DATE,

      IF(POL_TYPE<>'F',T_DATE) AS I_DATE

I also added following line to the script in order to calculate the no of days between  I_DATE and C_DATE

(C_DATE)-(I_DATE) AS NUMDAY

But NUMDAY is blank in the output table. Have i done any error? How can I do the calculation correctly. Pls help

15 Replies
upaliwije
Creator II
Creator II
Author

Yes, What you say is true. I have created two fields from one filed ? How can I solve this problem pls ?

tresesco
MVP
MVP

You have to handle this in the modelling. Could you post your table structure containing these dates?

upaliwije
Creator II
Creator II
Author

Here is my sample data

migueldelval
Specialist
Specialist

Hi Upali,

Try this example, please.

You can see your requirement in table (Sheet2), and in script (Main2).

Regards

Miguel del Valle

upaliwije
Creator II
Creator II
Author

Thanks

Is there any way of creating field (C-date-I_date) in the load script. then only I can have following age analysis

LOAD *,

if(C_DATE-I_DATE <=30,DUAL('30 DAYS',1),

if(C_DATE-I_DATE>30 AND if(C_DATE-I_DATE<=60,DUAL('60 DAYS',2)),

if(C_DATE-I_DATE>60 AND if(C_DATE-I_DATE<=90,DUAL('90 DAYS',3)),

if(C_DATE-I_DATE >90,DUAL('>90 DAYS',4)))))AS AGE,

Not applicable

Hi

Try resident all data then differentiate the aging.

Temp:

Load C_DATE,

          I_DATE,

          C_DATE-I_DATE  as DAYS_DIFF

From

DataTable;

DDAYS_DIFF_AGING:

Load *,

if(DAYS_DIFF <=30,DUAL('30 DAYS',1),

if(DAYS_DIFF>30 AND if(DAYS_DIFF<=60,DUAL('60 DAYS',2)),

if(DAYS_DIFF>60 AND if(DAYS_DIFF<=90,DUAL('90 DAYS',3)),

if(DAYS_DIFF>90,DUAL('>90 DAYS',4)))))AS AGE

Resident Temp;

Drop Table Temp;