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

Sort dates and compare two years

Good morning all,

I come to you because I have two problems that I cannot explain and solve.

THE FIRST POINT

By selecting a month, I'm comparing the year N and N-1 and with a correct sort.

comparer un mois N et N-1.PNG

when I select a week, the sorting no works agin

Tri par jour et mois.PNG

How do you create a filter that sorts correctly regardless of the Time dimension?


This is what my dimension looks like:

dim.PNG

THE SECOND POINT

I created two DATEPICKER objects, in order to be able to enter a start date and an end date.

filtre calendrier_LI (2).jpg

When I select dates, I lose the possibility of having my comparisons between the years.

résultat filtre calendrier.PNG

I do not understand why !

Here are my two problems of the moment.

Thank you in advance for your help.

Best !

1 Reply
edwin
Master II
Master II

theres a lot going on here and its hard to figure out whats going on without a QVW.

one thing i did notice is that in your screenshot you are sorting your date as text.  but this could be because you are always showing only one month of data?

as to the sorting for weeks, you should use dates and sort it numerically

as for the last question, it may be because of your data model (again this without really seeing your data model)  maybe when you filtered for a date range, there is no association with the prior year - hence you lose the comparison.  to fix this, there are a few ways.  one is to create a bridge table that will create an association between your current year and your prior year so that selecting a date range for the current year selects the same date range prior year at the same time