Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
You can use this expression then as a calculated dimension in your chart:
='Week' & num(floor((RollupDate- min(total RollupDate)) / 7) + 1)
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.
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.
You can use this expression then as a calculated dimension in your chart:
='Week' & num(floor((RollupDate- min(total RollupDate)) / 7) + 1)
Thanks that did it.
Cool solution Nick!
-Rob