1 Reply Latest reply on Dec 16, 2016 6:26 AM by Norbert Maijoor

    Need assistance in fixing X axis values.

    Vivek S

      I want to show a bar chart showing aging of Projects pending in some particular task.

       

      I have column "task_completed_date" with date present if task "Completed" else task is considered as "Pending".

       

      I need to show count of all Pending projects with selected task as "Pending" caluculated using above logic & aging falls within in following buckets -

       

      a) 1-30 days

      b) 31-100 days

      c) 101-200 days

      d) 201 - 300 days

      e) > 300 days

       

      Aging is caluculated using Refernce_date (dynamically choosen by user, we have created a parameter) -(minus) project_start_date.

       

      Like, if my calculated measure aging value is 20 then in 1-30 days, else if 150 days then it will lie between 101-200 days.

       

      Issue is when I am plotting a bar chart, at x-axis I am not getting that group present for which value is Zero. i.e. If no project is falling

      in a particular aging bucket, then that bucket wont show up and chart seems incomplete.

       

      Can we acheive fix 5 values on x-axis somehow in tableau irrespective of no of projects fall in that buckket and plot bar as per the logic above.

       

      I am new to Tabelau and just started working on Tableau, any suggestions to this will be helpful.

       

      Thanks in advance !

        • 1. Re: Need assistance in fixing X axis values.
          Norbert Maijoor

          Hi Vivek,

           

          Find my approach as reference below and stored in attached workbook version 9.3

           

          bins:

          if DATEDIFF('day',[Date],TODAY())>=0 and DATEDIFF('day',[Date],TODAY())<30 then "1-30 days"

          elseif DATEDIFF('day',[Date],TODAY())>=31 and DATEDIFF('day',[Date],TODAY())<100 then "31-100 days"

          elseif DATEDIFF('day',[Date],TODAY())>=101 and DATEDIFF('day',[Date],TODAY())<200 then "101-200 days"

          elseif DATEDIFF('day',[Date],TODAY())>=201 and DATEDIFF('day',[Date],TODAY())<300 then "201-300 days"

          elseif DATEDIFF('day',[Date],TODAY())>=300 then "> 300 days" END