4 Replies Latest reply on Mar 24, 2017 3:04 PM by Flora Fu

# Urgent Calculation Help is needed.  Thank you~

Hi Tableau Gurus,

Please see example below:  I am trying create a new field that could combined the TERM values if there is more than one at the account level. (In fact, one account may have more than one terms)

For example, account 10000003 has two terms, Net 30 and net 60, I need the new field look like "Net 30/Net 60"

Is this calculation doable in Tableau? Any help is predicated!

Thank you,

Flora

• ###### 1. Re: Urgent Calculation Help is needed.  Thank you~

Hi Flora

If you have max two in one account, below is one idea.

[Text Combined]

if {fixed[Account]:countd([Term])}=1 then [Term]

else left({fixed :min([Term])},6)+"/"+left({fixed :min([Term])},6) end

If you have more than two, kind of tricky..

Easiest way I can think out is using dashboard.

Thanks,

Shin

• ###### 2. Re: Urgent Calculation Help is needed.  Thank you~

Hi Flora Fu,

This link might actually help: Re: Concatenating data from child rows

I created a sample approach using Sample Superstore by creating table calculations:

1. Create a calculated field called INDEX. Once created, right click to convert it to Discrete.

2. Drag it in between Account & Term Name similar to below. Right click, and then Compute Using > Term Name as we are calculating index across term name by account ID

3. To create the concatenation, we use the following formula, which says if index=1 then return the segment else take the previous value and concatenate with the segment

4. Then, to only pull the last row, we create the following field to be used as a filter and only select the TRUE. Ensure that it is computing along term name

Final result:

1 of 1 people found this helpful
• ###### 3. Re: Urgent Calculation Help is needed.  Thank you~

Thanks for the example workbook Mara!

I actually concatenate data using Alteryx instead of Tableau.  But it's always good to learn about the possibility. Appreciate your knowledge and help very much!

Flora

• ###### 4. Re: Urgent Calculation Help is needed.  Thank you~

Thank you Shinichiro,

I actually already resolved the issue using Alteryx.  Thank you so much for your input!

Have a good day!

Flora