5 Replies Latest reply on Oct 27, 2016 9:19 AM by Joe Oppelt

# Best approach to spliting a Paramater float across a Table of percentages??

Hi all

So i have a basic bar chart

#Score as Column

the #score becomes SUM(SCORE) and then i apply the ANALYSIS/PERCENT OF TABLE

This all works..

So now i have a number in a Parameter box, this is for the user to input this years budget allocation and for that budget to be divided across the percent of scores.

Eg, If i had £100, and 4 Categories at 10%, 20%, 20% and 50%, I would expect £10, £20, £20 and £50

I did try to make a Calculated field, but it seems very hard to do this based on the same Measure

I am not really sure how to proceed here, any help would be appreciated, I am sure this is simple, but minds a blank!

Thanks,

Ben

• ###### 1. Re: Best approach to spliting a Paramater float across a Table of percentages??

Ben

Would be able to post your work and how far you have done. Thank you

• ###### 2. Re: Best approach to spliting a Paramater float across a Table of percentages??

What you want to do is create your own [Percent of Table] calc that you can use in other calcs.

To write your own, right-click on the one Tableau has generated for you.  Select EDIT IN SHELF.  (assuming you are version 9.0 or later.)  That creates a temp editor right in place where you clicked.  Cut-and-paste the code you get there into your own calc.  Now you have your own version of that calc to use in other places.

From there, you can do [Percent of Table]*[Whatever you named your parameter], and you will allocate the parameter value by the percent of table values.

If you struggle getting this to work, upload a sample workbook and I'll help you with it.

1 of 1 people found this helpful
• ###### 3. Re: Best approach to spliting a Paramater float across a Table of percentages??

I was in the middle of making a fake WB when the below pooped in, but thanks for the offer!

• ###### 4. Re: Best approach to spliting a Paramater float across a Table of percentages??

Thank you, the aggrigation of the Calc was where i was getting lost.

handy feature that "Edit in Shelf"

All works a treat now, thanks!!

• ###### 5. Re: Best approach to spliting a Paramater float across a Table of percentages??

For the record, you could have bypassed creating your own calc.  I do it that way to keep steps compartmentalized, and in my opinion makes debugging things easier.  (And makes it easier for the next guy to pick up what I did in there.)

But you could have bypassed making the extra calc.

When you are in your calc editor, you can drag the quick table calc from your shelf directly into the calc editor.  Give it a try.  You'll see that when you do this, Tableau expands it into the underlying code right there in your editor.

1 of 1 people found this helpful