Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Week's Min & Max Date as Dimension?

I am trying to display the start and end dates of a week as a dimension in a line chart. I have a Date field and a Week field, but can't figure out how to put the two together so that one dimension would show a value for things completed between 10/20/2013 - 10/26/2013, for example. The attached image shows what I am trying to do. Any help would be appreciated.date range dimension.JPG.jpg

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use a calculated dimension: =weekstart(MyDate) & '-' & weekend(MyDate). Or create a field using that expression in the script and use the new field as dimension.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Use a calculated dimension: =weekstart(MyDate) & '-' & weekend(MyDate). Or create a field using that expression in the script and use the new field as dimension.


talk is cheap, supply exceeds demand
Nicole-Smith

Another option is to use the class function.  See the attached for an example.

Not applicable
Author

Gysbert Wassenaar, that's it! The only issue I have now is sorting, especially now in the new year since we have dates from early months this year and late months last year. I've tried using all of the Sort by defaults but they don't get it right, I'm guessing some type of expression will need to be used?

date range sorting.JPG.jpg

Not applicable
Author

Class function is a possibility. Another is to order your "week strings" according to an expression, like:

=Avg(MyDate)

ascending. Should work here.

Clever_Anjos
Employee
Employee

To fix sorting use weekstart(MyDate) as Sorting Expression