Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

No of dates calculation

Hi,

I need to calculate no of dates in new field. I made it as follows in script. But its not working. need your help......

LOAD *, Interval([LOSS_DATE]-12/31/2014) as 'DURATION';

Load * Inline 

LOSS_DATE

18-Jun-14

18-Jun-14

21-Jun-14

9-Jul-14

18-Jul-14

5-Jul-14

]; 

Thankz,

Dhanushka.

1 Solution

Accepted Solutions
maxgro
Not applicable

Re: No of dates calculation

RESULT

1.png

SCRIPT


SET MonthNames='jan;feb;mar;apr;may;jun;jul;aug;sep;oct;nov;dec';

LOAD *, date#([LOSS_DATE], 'DD-MMM-YY')-makedate(2014,12,31) as 'DURATION';

Load * Inline

[

LOSS_DATE

18-Jun-14

18-Jun-14

21-Jun-14

9-Jul-14

18-Jul-14

5-Jul-14

];

see here for detail

QlikView Date fields

4 Replies
maxgro
Not applicable

Re: No of dates calculation

RESULT

1.png

SCRIPT


SET MonthNames='jan;feb;mar;apr;may;jun;jul;aug;sep;oct;nov;dec';

LOAD *, date#([LOSS_DATE], 'DD-MMM-YY')-makedate(2014,12,31) as 'DURATION';

Load * Inline

[

LOSS_DATE

18-Jun-14

18-Jun-14

21-Jun-14

9-Jul-14

18-Jul-14

5-Jul-14

];

see here for detail

QlikView Date fields

its_anandrjs
Not applicable

Re: No of dates calculation

You can try this also

LOAD *, Interval( date#([LOSS_DATE], 'DD-MMM-YY') - Date#('12/31/2014'),'d') as 'DURATION';

Load * Inline

[

LOSS_DATE

18-Jun-14

18-Jun-14

21-Jun-14

9-Jul-14

18-Jul-14

5-Jul-14

];

Regards

Anand

Not applicable

Re: No of dates calculation

Thank You very much.................

Not applicable

Re: No of dates calculation

Thank You Very Much.

Its also working....

Community Browser