1 Reply Latest reply on Oct 10, 2018 1:23 PM by Yuriy Fal

    Formatted date calculation then order by original date bug?

    X T

      Hi,

       

      As I don't want to display MDY auto-hierarchy (users not using American date format!), so I had to write my own calculation of DD-MM, which is fine.

      ( something discussed in https://community.tableau.com/ideas/2549).

       

      However when I try to order by the original date, the result is wrong.

       

      I will have multiple record under the same date (aggregated in the result), so Min (Original date) is the same for any individual DD-MM of a year, say 5th Oct of 2018.

       

      However If I sort on my calculated DD-MM (already separated by Year dimension), I sort on Min(Original date), and result is wrong.

       

      I think it's a bug? Any ideas as you can see from the result? October->November->December, then again October->November->December, within the same year?) Why it is partially ordered? Or my understanding of how Sort works is entirely wrong?

       

       

       

       

       

      ask Tableau.png

       

       

      If I use Min(Original Date) to sort, then 2018 looks good, but 2019 became wrong order ( Oct->Nov->Jan->Feb->Sept->Nov->December):

      ask Tableau2.PNG

        • 1. Re: Formatted date calculation then order by original date bug?
          Yuriy Fal

          Hi X T,

           

          Sorting a Dimension Pill (even using an aggregate for that)

          doesn't take into account any other Pill that might be on a view.

          Think of it as if the actual sorting happens before rendering a view.

           

          With that in mind it is easy to witness the seemingly 'strange' behaviour

          of your 'Day Number & Month Name' combined Dimension Pill,

          as it may contain a single Date (from either Year) or many (from several Years),

          thus giving a different result when sorting by MIN(Date) or MAX(Date).

           

          Please find the attached as an example.

           

          Yours,

          Yuri