Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
singhcv123
Contributor
Contributor

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
MVP
MVP

try to create date lik below

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

sunny_talwar

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