Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pinky1234
Contributor III
Contributor III

Need help on data format in sequentical

Hi,

I have a date which is in this format YYYY-MM-DD 00:00:00.00000 and I would like to use this date in X axis format like this Jan-2022,Feb-2022,Mar-2022,Apr-2022,May-2022,Jun-2022,Jul-2022,Aug-2022,Sep-2022,Oct-2022,Nov-2022,Dec-2022,Jan-2023,Feb-2023...etc. like this. Can some one help me with code how to achieve this? 

Example:

StartDate: 2022-04-30 00:00:00.00000, 2022-06-30 00:00:00.00000, 2022-02-10 00:00:00.00000...etc

And I wanted start date like this Jan-2022,Feb-2022,Mar-2022,Apr-2022,May-2022,Jun-2022,Jul-2022,Aug-2022,Sep-2022,Oct-2022,Nov-2022,Dec-2022,Jan-2023,Feb-2023..

Thanks in advance!

Labels (4)
6 Replies
MarcoWedel

Date(MonthStart(Date#(StartDate, 'YYYY-MM-DD hh:mm:ss.fffff')),'MMM-YYYY') as StartMonth
sidhiq91
Specialist II
Specialist II

@pinky1234  Please use the below expression in the back end:

NoConcatenate
Temp:
Load Date(Monthstart(Timestamp#(Date,'YYYY-MM-DD hh:mm:ss.fff')),'MMM-YYYY') as Date

Inline [
Date
2022-04-30 00:00:00.00000
2022-06-30 00:00:00.00000
2022-02-10 00:00:00.00000
];

Exit Script;

This should resolve the issue.

pinky1234
Contributor III
Contributor III
Author

Hi,

Thanks for Reply!

The issue that I am facing here is after converting start date to MMM-YYYY format, I wanted to use start date as x axis for bar chart and sort the dates in sequence in order. Jan-2022,Feb-2022,Mar-2022,Apr-2022,May-2022,Jun-2022,Jul-2022,Aug-2022,Sep-2022,Oct-2022,Nov-2022,Dec-2022..etc. Can you help me to achieve this?

 

pinky1234
Contributor III
Contributor III
Author

Hi,

Thanks for Reply!

The issue that I am facing here is after converting start date to MMM-YYYY format, I wanted to use start date as x axis for bar chart and sort the dates in sequence in order. Jan-2022,Feb-2022,Mar-2022,Apr-2022,May-2022,Jun-2022,Jul-2022,Aug-2022,Sep-2022,Oct-2022,Nov-2022,Dec-2022..etc. Can you help me to achieve this?

MayilVahanan

Hi

By default, date has number format. so we can sort by asc or desc. 

Try to Change the sorting order in the bar chart.

 

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
MarcoWedel

That should be default behaviour given this MonthYear field.
Can you please post screenshots that show your settings as well as your current result being sorted other than expected.

thanks