Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I've trying to create a simple table where the user can select a value from a custom filter and the 1st dimension of a table changes to that selected dimension.
Created an island table of friendly names
Load * inline[
DimName, DimNum
Red, 1
Blue,2
Green, 3];
created a variable for selection
vCustomDimName =only(DimNum)
created a variable to change into correct dimension name
vCustomNameSwitch =
if($(vCustomDimName) =1, 'RED',
if($(vCustomDimName) =2, 'BLUE', 'GREEN'))
created a filter that uses 'DimName' , which looks as expected with friendly names Red, Blue, Green
if i create a text box with $(vCustomNameSwitch) it correctly changes it to the proper dimension name RED,BLUE,GREEN
then thought i could just created a table and use
$(vCustomNameSwitch) as my dimension name but it errors with invalid dimension , any ideas what's going wrong, or have I taken the wrong approach?
many thanks
many thanks
Hi, having a dimension like [$(vCustomNameSwitch)] should work if the value of vCustomNameSwitch exactly matches the name of the field,it should be in the sema casing as the field name, have you confirmed it has the exact same name?
Sample attached
I notice that the field names in the pick list are in Capitalized case, but I'm the if statement you use UPPER case. Could that be an root cause to your problem? The value needs to be identical to the field name.
Hi try this
=Pick(
Only(DimNum),
[RED],
[BLUE],
[GREEN]
)
Or as suggested by vegar try this
=Pick(
Match(Upper(Only(DimName)), 'RED', 'BLUE', 'GREEN'),
[RED],
[BLUE],
[GREEN]
)