Skip navigation

Reference alias value in formula

score 7
You have not voted. Active

It would be useful to use a field value alias, or parameter "Display as" value (which I think of as an alias), within a function. For example, formula code such as:

 

iif([My Field]=[My Parameter], [My Field], "Other")

 

Is more efficient if the comparison field and parameter are integer values, but I can't use integers if I want to return a text value for use on screen. In this example both [My Field] and [My Parameter] can be defined and stored as integers, with aliases applied to help on-screen presentation, but this formula will present an error because it is returning either an integer or a string ("Other")... so the solution is to use string fields and parameters, at a cost to performance.

 

The idea is to be able to reference the alias of a field or parameter value e.g.

 

iif([My Field]=[My Parameter], [My Field].alias, "Other")


or

iif([My Field]=[My Parameter], alias([My Field]), "Other")


i.e. as a property (although I know Tableau doesn't present information this way) or a function (less elegant, but more Tableau-esque).

Comments

Vote history