Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.
singhcv123
New Contributor II

Date conversion and filter issue

We are facing recent date change and filter problem in one of our report.

the back ground of issue is give bleow:

in datasource date is like :     [created date] 2016-03-29 22:35:19

we are converting  that date in QVD load stage like Date ([created date].'DD/MM/YYYY')

finally we want to filter the data in qvw layer by using variable :

vstartdate=Date(Num(Today() -20),'DD/MM/YYYY')

WHERE Date([created date],'DD/MM/YYYY') = '$(vstartdate)'

BUT WE ARE not getting any out ....am i doing somethine wrong.....

2 Replies
Chanty4u
Esteemed Contributor III

Re: Date conversion and filter issue

try to create date lik below

Date(Date#([created date] ,'YYYY-MM-DD mm:ss:hh'),'DD/MM/YYYY')  as NewDate

Re: Date conversion and filter issue

Couple of things here....

1) If you don't need the time portion of the created date, remove it. Just because you have formatted it as Date(), doesn't mean the time portion is removed, use Floor() to remove it.


Date(Floor([created date]), 'DD/MM/YYYY') as [created date]

2) Try using it like this:

vstartdate = Num(Today() -20);

Where [created date] = $(vstartdate)

But your existing should also work, but I prefer using Num(), instead of date in where clause.

HTH

Best,

Sunny

Community Browser