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: 
niranjana
Creator
Creator

Date Field

I have a date field  in this format "01/04/2023 00:01:21" . I want list boxes with unique values like Jan-23, feb -23 etc. I tried using this expression "Date(floor(Timestamp#(REQTIME,'DD/MM/YYYY HH:MM:SS')),'MMM/YYYY')" in both script and list box in qlikview but it gave values like "Jan-23, Jan 23, Feb-23, feb 23 ' etc. 

request a  solution in script or chart or list box....

Thanks in advance

Niranjana

Labels (1)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

Try with:
Date(MonthStart(Timestamp#(REQTIME,'DD/MM/YYYY HH:MM:SS')),'MMM/YYYY')

View solution in original post

3 Replies
vincent_ardiet_
Specialist
Specialist

Try with:
Date(MonthStart(Timestamp#(REQTIME,'DD/MM/YYYY HH:MM:SS')),'MMM/YYYY')

Aasir
Creator III
Creator III

Modify your script expression slightly. Use the MonthName function to get the month name in three characters (e.g., "Jan") and concatenate it with the year. Here's how you can adjust your script:

MonthName(Month(Timestamp#(REQTIME, 'DD/MM/YYYY HH:MM:SS')), 'MMM') & '-' & Year(Timestamp#(REQTIME, 'DD/MM/YYYY HH:MM:SS')) as MonthYear

niranjana
Creator
Creator
Author

Hi ,Thanks for your reply. Your expression works. But I used another format  : MonthName(Date(Floor(TimeStamp#(REQTIME, 'DD/MM/YYYY h:mm:ss')), 'DD/MM/YYYY'))

This also worked.