Forum Discussion
Dates improperly aggregating in visualization
- 9 years ago
A few things you need to fix.
1. My example of using a number (1-12) was an example if you have a Month column. Since you are using Month and Year, you need to make a unique order column for this value. I would make a calc column (query editor) that takes Year*100+Month. This will give you values like 201601 for Jan2016, 201602 for Feb2016 etc. Make sure the data type is numeric and this will allow you to sort correctly across multiple years.
2. You don't need to concantenate this unique sort order column with the Month Year column. Just select the field from the fields list, go to the Modeling tab, and choose Sort By > Unique Sort Order column.
Ok, in a table visual Select
in Axis Reported Date-Herarchy--Month
in Legend Reported Date-Herarchy--Year
in Values Count of Change}
Let me know if you need more help
The auto date hierarchy you are encountering automatically aggregates the data based on the level of the hierarchy you are in. So, in a monthly view, you will see months 1-12 with data possibly (and in your case definitely for Jan) being counted from multiple years. The easiest way to change this is to click on the drop down arrow from the Date field in the Visuals area and select Date instead of Date Hierarchy.
However, if you want to see the data at a monthly level but distinguishing years, you will have to follow some of the methods given above.