Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting Dateformats

Hi all,

I have a question I hope someone would be able to help me with. I have a column which displays date in varying formats: some are 'DDMMYYYY', some are 'MMDDYYY', some 'YYYYMMDD' and so on and so forth. Is there perhaps a command that would count all the distinct date formats and then report a count for each? I suppose something along the lines of Count(if(.....) as expression and Count distinct as dimensions in a chart, but I can't figure out a precise format.

Thank you all so much!


1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

You need to look at Alt() function

alt(date#(DateString, 'YYYY-MM-DD'), date#(DateString, 'DD-MM-YYYY'), date#(DateString, 'DD/MM/YYYY'), 'No Date Found') AS Date

Replace it with your required format.

http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/25/which-conditional-functions-do-you-use

Regards

ASHFAQ

View solution in original post

3 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

You need to look at Alt() function

alt(date#(DateString, 'YYYY-MM-DD'), date#(DateString, 'DD-MM-YYYY'), date#(DateString, 'DD/MM/YYYY'), 'No Date Found') AS Date

Replace it with your required format.

http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/25/which-conditional-functions-do-you-use

Regards

ASHFAQ

Not applicable
Author

Thank you so much! You've been very helpful!

ashfaq_haseeb
Champion III
Champion III

Welcome