3 Replies Latest reply on Dec 6, 2018 8:48 AM by Jim Dehner

    Date Concatenated with Text-Sorted by Date

    Pamela Chandra

      Hi,

       

      I have a concatenated calculated field, that I am using as a filter .  The concatenation uses a data field. I would like to sort the filter drop down based on date field that is used in the concatenation. Currently it is sorting alphabetically as the calculated field is a string .

      Can anyone please help me achieve this .

      Please use the workbook attached .

       

      Thank you,

      Pamela

        • 1. Re: Date Concatenated with Text-Sorted by Date
          Jim Dehner

          Good morning - the concatenation results in a single string value as text for each record

          - there is no longer a Date per se - if you move the Date to the first field in the concatenation then the sort will be by the STRING version of the date

           

           

          Jim

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          • 2. Re: Date Concatenated with Text-Sorted by Date
            Pamela Chandra

            Thank you Jim. This I know is working as expected and not really a limitation, but just to meet a client requirement I was looking for  workarounds.

            Would you know if we can use the Custom Date Format (withing Default Date format) can display the text value preceding the date. This would still be a date field, but the display could use the other text values concatenated to date.

             

            Si that an option we can explore. Can we tweak this option Custom Date Formats - Tableau  to achieve this scenario?

            Thank you,

            Pamela

            • 3. Re: Date Concatenated with Text-Sorted by Date
              Jim Dehner

              Hi

               

              Dates are a data type and string is a different data type - concatenation only works on strings -

               

              Take a step back and ask your self what is it the client really wants - if they want to be able to filter on date and then see only the "Level 1 and Level 2" records that are in that range you can do that with "Only Relevant values" and you can sort the l1-l2 dimension alphabetically

               

              Jim