cle
cle

Reputation: 1

Tableau: How to edit aliases, if I use only one source?

I know I can change aliases if I have primary and secondary source in use. However, while using only one source (excel), there's no option as 'Edit alias'. Is there any alternative, i.e. create calculate field?

Specifically: I need to keep the months in order, but don't want to display digits instead of months names. So I want to change {2;3;...;11} into {"October";...;"June"} on the axis.

Upvotes: 0

Views: 3054

Answers (3)

Alex Blakemore
Alex Blakemore

Reputation: 11906

If you are simply concerned with presentation, the easiest approach is to use formatting.

If your field has datatype of Date, then you extract just the Month part by right clicking on the pill. Tableau will retain the calendar sort order.

Then right click on a month name and choose format, and you can choose from several Date formats for presentation -- Full name, abbreviation, first letter or numeric.

enter image description here

Upvotes: 0

Nick
Nick

Reputation: 7451

I assume that you have data similar to this - at least with regards to the Month_Number and Month_Name.

enter image description here


There are a few ways to get you what you want...

Option #1 - Sort by another field:

  • Right-click on your month name field and select sort. Within the popup, under Sort by, check "Field" and select the field that contains the number of your months. The aggregation can be Minimum or Maximum - it is benign as long as you are showing your data at the month grain (which you are).

enter image description here

Option #2 - Use and hide the number field header:

  • Make sure that your month number field is a discrete dimension then simply place it before the month name field on the shelf (rows or columns).

  • Right click on the month number field and un-check 'Show header'.

enter image description here

Option #3 - Create a calculated date field:

  • Create a new calculated field and reference your month number field within the MAKEDATE() function.

enter image description here

  • Use this new field as a date and benefit from the features Tableau provides to date - including proper ordering.

enter image description here

Upvotes: 1

lampbob
lampbob

Reputation: 781

Is this just for 1 year? If I understand you question correctly you could use a calculated field like this:

CASE str([Month])
WHEN str(1) THEN 'Jan'
WHEN str(2) THEN 'Feb'
WHEN str(3) THEN 'Mar'
WHEN str(4) THEN 'Apr'
WHEN str(5) THEN 'May'
WHEN str(6) THEN 'Jun'
WHEN str(7) THEN 'Jul'
WHEN str(8) THEN 'Aug'
WHEN str(9) THEN 'Sep'
WHEN str(10) THEN 'Oct'
WHEN str(11) THEN 'Nov'
WHEN str(12) THEN 'Dec'
ELSE str(0)
END

Then pull that field/pill into your shelf and exclude the 0 results. Just built this quickly so there may be better solution out there.

If you have access to edit the excel file it may be better to add a proper date field/column here and do it that way.

Upvotes: 0

Related Questions