4 Replies Latest reply on Nov 14, 2019 3:38 AM by Zhouyi Zhang

    Merging Decimal + String Values with Nulls

    TD R

      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.

       

      Thank you in advance.

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

          Hi, TD

           

          Please find my solution below

           

          Hope this helps

           

          ZZ

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

            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
              TD R

              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
                Zhouyi Zhang

                Hi, TD

                 

                You can add multiple condition as below way

                 

                Hope this helps.

                 

                If this solves your question, please mark my answer as correct to close the thread. Ta

                 

                ZZ