9 Replies Latest reply on Nov 15, 2019 9:11 AM by TD R

# Merging Decimal + String Values with Nulls

Hi- I am trying to combine two different data types and round the values in one and use brackets and Percentage sign on the other.

Decimal value data needs to be rounded to 2 decimal and use % sign only on index 5

And String Values need to be in Brackets

Index  Decimal   +  String             Result

Value data      Value data

1     23.6499991    Null                23.65

2      452              7/1                  452(7/1)

3     11.500000     32k                11.50(32k)

4     Null               Null                   Blank

5     4                  (454)                 4%(454)

Is the desired result doable in tableau any ideas and suggestion are welcome.

• ###### 1. Re: Merging Decimal + String Values with Nulls

Hi, TD

Hope this helps

ZZ

2 of 2 people found this helpful
• ###### 2. Re: Merging Decimal + String Values with Nulls

Thank you ZZ for your help. I am almost there with my solution. one last thing left with my req is

Index         Decimal Data type                Target Result

6                       5.23                                      5.23*

7                         0                                           0

8                       40                                         40

9                      0.23                                      0.23%

10                      5                                          5%

11                     7.80                                      7.80%

12                       45                                       45%

It will be great if you could provide me with this requirement on the 5.23 I need to add a *  and from index 9 to 12 I need to add % sign.

Once again ,ZZ thank you for helping in this forum.

• ###### 3. Re: Merging Decimal + String Values with Nulls

Hi ZZ , can I do more then 1 index i.d for the % sign?  suppose I have  5 to 6 values in that column that I need to add % sign  can I put IF [Index] = 5,7,8,9 and 10

Thank you ZZ for your help!

• ###### 4. Re: Merging Decimal + String Values with Nulls

Hi, TD

You can add multiple condition as below way

Hope this helps.

ZZ

2 of 2 people found this helpful
• ###### 5. Re: Merging Decimal + String Values with Nulls

Thank you ZZ!

• ###### 6. Re: Merging Decimal + String Values with Nulls

Thank you ZZ for your help. I have one issue that came out. Null on decimal and Null on string values should be blank instead of Null

and when there is a 0 is decimal and (0) string value it is showing as null too instead of 0 (0)

decimal 0 and sting value (234) it should show 0 (234) instead of null or

0                        Null                 then  0

can you please provide some help ?

thank youZhouyi Zhang

• ###### 7. Re: Merging Decimal + String Values with Nulls

try this

IFNULL([Calcualtion 1],'0')

ZZ

• ###### 8. Re: Merging Decimal + String Values with Nulls

Thank you ZZ! It is giving only 0.

but I have some values in string column 45 it should return 0 (45). my requirement is to add the string value has well if there is a 0 then it should return me with 0 (0). not Null

is that possible Zhouyi?

• ###### 9. Re: Merging Decimal + String Values with Nulls

Hi ZZ,   since i have 0 in decimal and in string i have 350 it should return me 0 (350) instead of NULL  or even if decimal is 0 & string is 0 then expected value should be 0 (0 ) instead of NULL.

IFNULL([Calcualtion 1],'0') on the calculation is only returning null to 0 and does not return the string value which should be 0 (350)

Is there any ways to achieve this?

Thank you for all the help and support Zhouyi Zhang