Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
george55
Partner - Creator III
Partner - Creator III

Sorting Time-dimension in Line Chart

Would like to sort one Axis by Year: 2020, 2019, 2018. This is a Timestampdimension. Using the calendar.Year Function.

mXIM_Zeit_Week: [XIM_CAL.StartTimeStamp.Calendar.Week]
mXIM_Zeit_Jahr: [XIM_CAL.StartTimeStamp.Calendar.Year]

Don't know how to sort this. Thanks.

2020.0303-161245.jpg

Labels (1)
1 Solution

Accepted Solutions
george55
Partner - Creator III
Partner - Creator III
Author

Thank you grynechkno for your posting.

Find the solution. I had already the timestamp loaded why I was wondering why it does not work. What I have done wrong: Instead of putting the formula on the second dimension I try it on the first one (see red arrow).

2020.0306-091324.jpg

View solution in original post

4 Replies
y_grynechko
Creator III
Creator III

Hey,

the best way is to create Week and Year fields in the load script and use it as a dimensions, it will fix sorting for you.

Other thing you can try is to sort by expression and use: XIM_CAL.StartTimeStamp

george55
Partner - Creator III
Partner - Creator III
Author

and how can I load a timestamp-dimension as a week dimension in the load script?

y_grynechko
Creator III
Creator III

loading timestamp as a date: 

date(floor(Timestamp)) as date

create date fields:

week(date) As Week,

 Year(date) As Year,

 Month(date) As Month,

 Day(date) As Day

george55
Partner - Creator III
Partner - Creator III
Author

Thank you grynechkno for your posting.

Find the solution. I had already the timestamp loaded why I was wondering why it does not work. What I have done wrong: Instead of putting the formula on the second dimension I try it on the first one (see red arrow).

2020.0306-091324.jpg