4 Replies Latest reply on May 3, 2018 9:07 AM by sathish Chidambaram

    Compare the dates to get latest two weeks data

    sathish Chidambaram

      Hi,

       

      I’m a new to Tableau and looking for inputs to compare the dates (Run date & Week end). ‘Week end’ is every Saturday and I run reports on next weekday. To calculate the projections, I need to match latest two weeks (04/07 & 3/31) of the ‘Week end’ and then sum the ‘Amount’.

       

      I calculated the first week end  from Run Date by ‘[Run Date] - DATEPART('weekday',[Run Date]) ‘.  When I try to compare ‘Week end’ with the calculated filed, getting Null value. I appreciate any help you can provide!

       

      Project

      week end

      Run Date

      Amount

      Proj1

      4/7/2018

      4/10/2018

      10

      Proj1

      4/7/2018

      4/10/2018

      51

      Proj1

      3/31/2018

      4/10/2018

      23

      proj1

      3/31/2018

      4/10/2018

      61

      Proj1

      3/24/2018

      4/10/2018

      30

      Proj1

      3/17/2018

      4/10/2018

      41

      proj2

      4/7/2018

      4/10/2018

      71

      proj2

      4/7/2018

      4/10/2018

      41

      proj2

      3/31/2018

      4/10/2018

      10

      proj2

      3/24/2018

      4/10/2018

      23

      proj2

      3/17/2018

      4/10/2018

      30

      proj3

      4/7/2018

      4/10/2018

      71

      proj3

      4/7/2018

      4/10/2018

      34

      proj3

      3/31/2018

      4/10/2018

      51

      proj3

      3/31/2018

      4/10/2018

      54

      proj3

      3/17/2018

      4/10/2018

      61

       

      Expected:

       

      Project

      Run Date

      Amount

      Proj1

      4/10/2018

      145

      Proj2

      4/10/2018

      122

      Proj3

      4/10/2018

      210