Qlik Community

Qlik Sense Cloud Discussions

chrisellis
Contributor

Data Formating

I am sure this has probably been asked before.

I have a date file in a csv file that looks like this 02 February 2017 and try as I might I can not format it to do a comparison on todays date.

Should the date and today use the format set in the application to match if the date field = today returning 1.

      Match(Date#("Date"),Date#(Today())) As "Active";

Any insight appreciated.

Chris

1 Solution

Accepted Solutions
vinieme12
Esteemed Contributor II

Re: Data Formating

Your date field is text and Date(today()) is num

So  try below


Match(DATE(Date#(Date,'DD MMMM YYYY')),Today()) As "Active";

2 Replies
vinieme12
Esteemed Contributor II

Re: Data Formating

Your date field is text and Date(today()) is num

So  try below


Match(DATE(Date#(Date,'DD MMMM YYYY')),Today()) As "Active";

omkarvamsi
Contributor

Re: Data Formating

what is assumed is ,you want the date format in today's date format.

if that is the scenario.

first we have to tell qlikview about how the date format is there for the field.

Ex: 02 February 2017

date#(Datefield,'DD MMM YYYY')

and now we have get desired date format(for suppose your desired format is 'DD-MM-YYYY',27-03-2017)

date(date#(Datefield,'DD MMM YYYY'),'DD-MM-YYYY')

hope i make the point.

please let me know anything you didnt get it

Community Browser