4 Replies Latest reply on Dec 10, 2018 7:14 PM by Ethan Lang

# [10.1] How to make my summation of specific rows more user friendly?

So I asked a question lasted week regarding the same data set here. However, my question was poorly stated, and decided to to try something else entirely.

My data set:

 Stop Name Stop ID Bus ID Fares Collected Main St 1 1 10 2nd St 2 1 5 Community College 3 1 30 University 4 1 50 HWY 3 5 2 50 Community College 3 2 100 Costco 6 2 20 Starbucks 7 3 20 I 405 8 3 100 2nd St 2 3 5 3rd St 9 4 0 4th St 10 4 5

My first customer wants: the total fare amount for all of Bus ID 1, Stop ID 2, Stop ID 3, and Stop Name 4th St. To accomplish this, I made the following calculated field:

SUM (

IF [Bus ID] = 1

OR [Stop ID] = 2

OR [Stop ID] = 3

OR [Stop Name] = '4th St'

THEN [Fares Collected]

END )

And, it worked perfectly! I got the correct fare amount (205). But now, customer B wants Bus ID 2, Stop Name Starbucks, and Stop Name Costco. Without having to write another calculated field, is there a way to write a customizable calculated field that could work for any potential customer?

• ###### 1. Re: [10.1] How to make my summation of specific rows more user friendly?

Hi Tyler,

Each of those calculations are 'hard coded', meaning they're being used for a very specific condition.  Is there a reason that filters cannot be used with each subsequent one then using 'Only Relevant Values' to further define what's available to the user in terms of available data and end-results?

That might be a better approach than using specific calcs for each customer?  Just a thought...thx, Don

• ###### 2. Re: [10.1] How to make my summation of specific rows more user friendly?

My initial thought was filters, but I couldn't seem to find a way to filter my information down to the level wanted.

For instance, customer 2 wants the total fares from: Bus ID 2, Stop Name Starbucks, and Stop Name Costco. But when I filter by Bus Id, and mark Bus ID 2, then all other stops not included in Bus ID 2 gets removed, namely Starbucks.

So if there is a way to filter by: Bus ID or Stop ID or Stop Name (where there isn't always overlap), it would be great.

Hope this makes sense.

Tyler

• ###### 3. Re: [10.1] How to make my summation of specific rows more user friendly?

Hi Tyler,

Then you're really looking at having to hard-code those scenarios in for each customer.

Alternatively, you could bring in customer ID or customer name to help you along, and then perhaps develop out a parameter for each customer, that is if all Customers are okay with seeing other Customers results...Customer A would see Customer B's results and vice-versa.

Your Parameter Filter would still be hard-coded for each customer's requirements however because of the desired overlap in criteria.  You can't currently multi-select items in Parameters such as Stop 1 and Stop 2, so you'll still need some calcs with multiple criteria to get where you need to be. Tableau is great at producing results, you'll just need to instruct it as to what...

Thx, Don

• ###### 4. Re: [10.1] How to make my summation of specific rows more user friendly?

You should be able to add those dimensions as filters then right click the pills in the filter pane, there should be an option that says “show filter”. select that and you will see thone filters appear on the right side of the screen. Click the arrow above the filter and you can change the way you can select from the filter itself. There should be an option for select multiple items that allows the user you simply check a box for the buses and routes they wish to see.