5 Replies Latest reply on Mar 7, 2016 10:12 PM by galaxy.tab

# Parameterize - Calculation

Hi Experts

I have the following case statement

CASE [Region]

WHEN "East" THEN IIF ( ISMEMBEROF("EastGroup"),1 ,0)

WHEN "West" THEN IIF ( ISMEMBEROF("WestGroup"),1 ,0)

WHEN "North" THEN IIF ( ISMEMBEROF("NorthGroup"),1 ,0)

WHEN "South" THEN IIF ( ISMEMBEROF("SouthGroup"),1 ,0)

ELSE 0

END

I want to parameterize both "Region" - East, West , North , South and the groups derived from the server , since I expect a lot of additional regions and groups to be added and this calculation needs to be dynamic to handle the users,

I will use this calculation as a data source filter.

• ###### 1. Re: Parameterize - Calculation

There could be a problem with this... Dynamic Parameters aren't available in Tableau desktop. Also any additional 'adds' to the 'member level security calc' - considering it's a calculation and all hard coded per member, this would require another manual interaction for any addition 'group' addition.

With that said, lets work on the calc:

What's the reasoning for the nested logic to output a 1 or 0 if it's a member of the or not..? That's a ton of if statements that may not be needed. Also currently given info provided I'm not seeing a need for a parameter. Lastly because I've been told once If statements are faster...

IF ISMEMBEROF("EastGroup") and [Region]=East THEN [Region]

ELSEIF ISMEMBEROF("WestGroup") and [Region]=West THEN [Region]

etc

END

Assuming if you've made it this far you're probably familiar with the support/remediation and content generation of the user/member table. Let me knnow if this gets you going the right direction. Also interested to see what the 'tagged' jedi's say.

Cheers!

Tyler Garrett

VP of Solutions & Strategy

TableauHelp.com LLC in Austin, TX

• ###### 2. Re: Parameterize - Calculation

So reason I used the CASE statement is :

IF (ISMEMBEROF("AllRegions")) Then 1

ELSE

(

CASE [Region]

WHEN "East" THEN IIF ( ISMEMBEROF("EastGroup"),1 ,0)

WHEN "West" THEN IIF ( ISMEMBEROF("WestGroup"),1 ,0)

WHEN "North" THEN IIF ( ISMEMBEROF("NorthGroup"),1 ,0)

WHEN "South" THEN IIF ( ISMEMBEROF("SouthGroup"),1 ,0)

ELSE 0

END)

END

Hence will need the paramterization as well, due to large number of regions expected. Along with region there is a probability of "County" data. So I will have to work on creating another calculated field and use it as data source filters

• ###### 3. Re: Parameterize - Calculation

Any update experts ?

• ###### 4. Re: Parameterize - Calculation

I don't know what you mean by "parameterization" here? Can you describe in more detail what you are trying to do?

Jonathan

1 of 1 people found this helpful
• ###### 5. Re: Parameterize - Calculation

Hi Jonathan,

CASE [Region]

WHEN "East" THEN IIF ( ISMEMBEROF("EastGroup"),1 ,0)

WHEN "West" THEN IIF ( ISMEMBEROF("WestGroup"),1 ,0)

WHEN "North" THEN IIF ( ISMEMBEROF("NorthGroup"),1 ,0)

WHEN "South" THEN IIF ( ISMEMBEROF("SouthGroup"),1 ,0)

As we see the above case statement, in the actual scenario there will be like 300 regions and more will be added to it dynamically on data update.

In the above calculation I have hardcoded both the Region Name and also the Tableau server groups.So this calculation will not hold good for number of users when they increase.

Is there a way to apply security when we have such a scenario in the Tableau level and not at the data level ? We can use the security table and join it with our model and use the USERNAME() function, but this will mean that the data table size will be huge and there will be a performance lag.

Thanks