3 Replies Latest reply on Jul 5, 2016 2:12 AM by Mark Fraser

    366 days using a calculated field

    thanigaivel.s

      Hi,

       

      I got a requirement where i need to generate all 366(2016) days in a calculated field?

       

      is it possible can anyone help me on this?

       

       

       

      Jonathan Drummey

      kettan

      Pooja Gandhi

        • 1. Re: 366 days using a calculated field
          Mark Fraser

          Hi Thani

           

          59 views and only this reply indicates we need more information from you to help...

           

          I got a requirement where i need to generate all 366(2016) days in a calculated field?

          What does generate all 366 days mean?

           

          If you need to use the figure 366 in a calculated field, why just not hard code it?

          Or you could use this -

          MIN(DATEDIFF('day',DATE('01-01-2016'), DATE('01-01-2017')))

           

          Tableau doesn't have an internal calendar you can reference, so if you need the individual dates from 2016, I would suggest importing a calendar (via Excel or equivalent) and joining your existing data to that.

           

          If you need further assistance, let me know, but more guidance would be helpful

           

          Cheers

          Mark

          • 2. Re: 366 days using a calculated field
            thanigaivel.s

            Hi Mark,

             

            Thanks for your reply, i have a date filed from TDE which something like,

             

            Month_Ending column

            31-Jan-2016

            29-Feb-2016

            30-Mar-2016 ... etc,

             

            but the requirement i got is to show that data in weekly basis by dividing the monthly fact data by number of weeks in the month, so i need to calculate a weekending data to show values,

             

            i need week ending date field something like this,

             

            01-Jul-2016

            08-Jul-2016

            15-Jul-2016

            22-Jul-2016

            29-Jul-2016

             

            how would i derive above week date's using the month_ending columns, is there any other way achieving this?

            • 3. Re: 366 days using a calculated field
              Mark Fraser

              Hi Thani

               

              I (think I) understand what you want...

              Personally, I would do this via a lookup table, then join it in Tableau, and use that.

               

              What that means...

              in Excel I have replicated your data, and created a lookup sheet (attached)

               

              In Tableau, we join them (how is important!)

              We then use the week values from the lookup

               

              Hope that's clear, and helps.

              If not, you have tagged in some of the brightest people here... so hopefully they can help

              The method is data scaffolding

               

              Cheers

              Mark