Hi from sunny Switzerland! I love mountains, hiking, running and skiing. I’m also a gear and data geek.

I’m on a mission to build an AI-powered health dashboard and I want to document this journey.

Follow me along!

← Back to posts

The alias functionality in Tableau is so practical, unfortunately it doesn’t exist in SAC. Let’s have a look at how we can bridge this gap.

What is an alias, and why Tableau makes it easy

So, what is an alias?

An alias is an alternate name for a member in a discrete dimension.

For instance, your dimension contains numbers or random codes, but you would like to display a meaningful text in your visuals.

I’m looking at a dataset where you see a list of passengers and in which harbour they’ve boarded a boat. The locations are identified with a one-letter code: C for Cherbourg; Q for Queenstown; S for Southampton.

Wouldn’t it be nice if my visuals were displaying the full name instead of the code?

It’s very easy to do that in Tableau, just right-click and create an alias.

Creating an alias in SAC with a calculated column

In SAC, we’ll have to create a calculated column:

The original dimension is called “Embarked”; the data file is called “train”.

IF([d/"train":Embarked]="C", "Cherbourg", IF([d/"train":Embarked]="S", "Southampton", "Queenstown" ) )

It’s a bit painful if you have several values. Shame there isn’t a function like SWITCH() in DAX available in SAC.

Here’s the result:

A simpler alternative: measure-based dimensions

An alternative way of doing it is to use a measure-based dimension. Leave “Use measure values as dimension members” unticked so you can define your own member names based on the dimension values. See screenshot below.

In this case, we have a ticket class defined with discrete numerical values: 1,2,3. We want to rename these upper, middle and lower class. The granularity of the dataset is a dimension called PassengerId.

Posted in

Leave a Reply

Discover more from Rosablanche

Subscribe now to keep reading and get access to the full archive.

Continue reading