DDT
DDT

Reputation: 41

Generated Time Dimension - change values of years

In SSAS, I have created a generated Time dimension in data source. The problem is, that the generated years are in format like "Calendar 2018" instead of just "2018", which is quite inconvenient, as I use the time dimension in Tableau afterwards and seeing "Calendar 2018" everywhere i need to show some trend looks bad. Is there any way to create the time dimension in way in which the years are in simple "2018" format? Or is there any way to manually change the data in the dimension? I would have used dimension based on my own table, but Tableau seems to not recognize it as "date" dimension and thus doesn't allow me to show the data as continuous lines, which is what i need. Thanks a lot.

Upvotes: 0

Views: 35

Answers (1)

Robert Crocker
Robert Crocker

Reputation: 678

Yeah, Tableau isn't going to interpret 'Calendar 2018' as a number. Converting that string to a number also won't get you far because of the word 'Calendar'.

Thankfully, there's a simple solution to this.

I've created a tiny table of data in Excel to simulate this solution.

enter image description here

Our calculation is going to separate the word 'Calendar' from '2018' and convert the year portion of the result to a number. That calculation looks like...

INT(SPLIT([Calendar Years], ' ', 2))

I'll drag this calculation to the columns self and drag the values column to the rows shelf. Lastly, we'll make sure we display our marks as a line.

Your result should look like.

enter image description here

Hope this helps! Happy vizzing :)

Upvotes: 2

Related Questions