Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Display max(Year month) and current Time

Hi Friends,As new to QlikView as it may simple myself not aware of things like Date in QV can any one help on below thing:

Modified date having updated/modified time stamp need to display max(Modified Date) in Jan 2015(MMM YYYY)

Modified Date
201501
201501
201501

How can we achieve this in a text object?

2)If i have combination as below

Modified Date
201501
201501
201409
2015Jan
2015Jan
201412

How can i show into Max(Modified Date)'as Jan 2015 MMM YYYY'

3 Replies
JonnyPoole
Former Employee
Former Employee

This should work. Date() is an output formatting function for display purposes.  Date# reads/interprets incoming data helping qlik to interpret the incoming format. you can use them together in tons of ways:

1.  Date( Max([Modified Date]) , 'MMM YYYY')

2.  i think you may need to read the YYYYMM and YYYYMMM differently...

date( if(  len([Modified Date]) = 7 ,  date#([Modified Date],'YYYYMMM') , date#( [Modified Date], 'YYYYMM') , 'YYYY MMM')

maxgro
MVP
MVP

2)

date(max(if(IsNum([Modified Date]), Date#([Modified Date], 'YYYYMM'), Date#([Modified Date], 'YYYYMMM') )), 'MMM YYYY')

dickelsa
Creator
Creator

The best way ( I think) is to use purgechar to recognise the letters in the string.

purgechar(<fieldname>,'<symbols>')

so for instance you can check in the script:

date(if(IsNull(Purgechar([Modified Date],'0123456789 ')), Date#([Modified Date], 'YYYYMM'), Date#([Modified Date], 'YYYYMMM') ),'YYYYMMM') as [Modified Date]


So now, you have your dates are in the same format you can simply put:

Next, in the dashboard you can put simply date(max(Date#([Modified Date],'YYYYMMM'),'MMM YYYY')

Best regards,

Dick