Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar chart with class demension and class labels

Have a bar chart that want to show data group by week (starting date plus 7 for 4 weeks). Have it kind of working but want the X labels to read "Week 1", "Week 2", etc. currently labels are "40334 <= Week < 40341", etc. See attached screen shot.

1 Solution

Accepted Solutions
Not applicable
Author

You can use this expression then as a calculated dimension in your chart:

='Week' & num(floor((RollupDate- min(total RollupDate)) / 7) + 1)


View solution in original post

5 Replies
Not applicable
Author

You can create a calendar table where you can calculate weeks in any suitable way for you.

It can be something like this:


Calendar:
load RollupDate,
dual('Week' & week(RollupDate), week(RollupDate)) as WeekToYearName,
dual('Week' & ceil(day(RollupDate) / 7), ceil(day(RollupDate) / 7)) as WeekToMonthName
;
load distinct RollupDate
resident <your table>;


After that you can use WeekToYearName or WeekToMonthName field as a Dimension in your chart.

Not applicable
Author

Thanks, but I don't think that will work for me. User of the chart is going to be able to select the starting date, so need to build the chart base on the starting data + 7 for 4 or 5 weeks.

Not applicable
Author

You can use this expression then as a calculated dimension in your chart:

='Week' & num(floor((RollupDate- min(total RollupDate)) / 7) + 1)


Not applicable
Author

Thanks that did it.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Cool solution Nick!

-Rob