Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kumarreddy257
Contributor

problem with subtracting days from date column

Hello Experts,

I have date column as time full date and it is having dates like daily. In report i want to display dates as subtract 7 days from time full date as mention below.

I tried with date(interval([Time Full Date] - 7,'D'),'YYYY/MM/DD'), but it is working for only first value and rest of dates are displaying continuosly. Pls help me out on this one.

Regards,

Kumar

10 Replies
danieloberbilli
Valued Contributor II

Re: problem with subtracting days from date column

date(floor([Time Full Date]) - 7,'DD/MM/YYYY')

danieloberbilli
Valued Contributor II

Re: problem with subtracting days from date column

in case that Time Full Date is a timestamp,

else just      date(num([Time Full Date]) - 7 , 'DD/MM/YYYY')

michael_gardner
Contributor III

Re: problem with subtracting days from date column

Dates can be tricky with qlikview.  Whenever I'm in doubt I'll convert the date field in the script to a number.  So create a second field Num([Time Full Date]) as [Time Full Date #] and use that in the interval expression you have above.

kumarreddy257
Contributor

Re: problem with subtracting days from date column

Hi Daniel,

As you suggested above I tried, but it doesn't work out. Pls see the screenshot.

Re: problem with subtracting days from date column

Hi,

This must work.

Try this in Script.

Provide your sample apps?

Regards

Regards,
Prashant Sangle
danieloberbilli
Valued Contributor II

Re: problem with subtracting days from date column

PFA my example and compare it to yours.

Kind Regards

Daniel

kumarreddy257
Contributor

Re: problem with subtracting days from date column

Hi,

Pls find the app.

Regards,

Kumar

Re: problem with subtracting days from date column

Hi,

169.6  MB How could you able to upload such huge file???

If possible post reduced file??

Use limited load

Regards

Regards,
Prashant Sangle
kumarreddy257
Contributor

Re: problem with subtracting days from date column

Hi

I have converted in script, but it is giving as same as previous. First date value is being deducting and rest of dates are displaying continuously.

Regards,

Kumar

Community Browser