Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasdavis500
Creator III
Creator III

Rename Dimension x-axis values

Is there a way to label what values are shown on the x-axis?

For example:

last_week.png

I would like 45-2016 to be renamed 'Current Week', 44-2016, 'Last Week', 43-2016, 'Two Weeks Ago', and so on and so forth..

Is this possible?

14 Replies
lucasdavis500
Creator III
Creator III
Author

This is awesome, the more I think about it though, it may just be easier for the end-user to also have a list box, and then make their selection for the week in the year that they wish.

For example,

Week_Year Listbox:

Jan 1 - Jan 7 2016,

Jan 8 - Jan 15 2016,

......

Dec 25 - Dec 31 2016

Is this possible in the script without hardcoding each week in?

johnw
Champion III
Champion III

I'd probably simplify a little and just do this:

date(weekstart(Date),'MMM D YYYY') as Week_Start

But for exactly what you show, I suppose:

dual(date(weekstart(Date),'MMM D') & ' - ' & date(weekend(Date),'MMM D YYYY'),weekstart(Date)) as Week_Year

It would be a little funny, with weeks like Dec 27 - Jan 2 2016, but I suppose that's still clear enough without putting 2015 in there as well.

lucasdavis500
Creator III
Creator III
Author

I love it, I'm not sure why anyone would use "weekYear" without doing something like this, how is an end-user supposed to know what dates Week 42 of Year 2016 contained..... Having date ranges simplifies this

johnw
Champion III
Champion III

I'd say week numbers are for companies that run on week numbers, and care much less what the dates are. If what's important to you is that it's week 42, then it's reasonable to display it that way. But if what's important are the dates, then a range seems best, but also takes a lot of space. A starting or ending date can be a space-based compromise, particularly if people are used to seeing a single date stand for an entire week, as they are at our company.

lucasdavis500
Creator III
Creator III
Author

Very good point. I'll have to address this issue with my end-users and understand what they would like to see. Having the week is nice, but you are right that it takes up a lot of space.