1 Reply Latest reply on Aug 21, 2016 2:49 AM by Tharashasank Davuluru

    Calculating upto that week in tableau

    Balaji Boyina

      Hi,

       

      I have a requirement where the data is as below.

       

             

      FACTIDCQCTARGETIDFSNVCIMAXOCCURFLAGALTFLAGWEEKNUMTRANSFLAG
      11012222.11ALL34RED
      21023331.31ALL34YELLOW
      31034442.71ALL34YELLOW
      41012231.92MOD35YELLOW
      51045551.71NEW35YELLOW
      61056661.91NEW35YELLOW
      71056640.72MOD36GREEN
      81012280.93MOD36GREEN
      91065452.21NEW36RED
      101076452.81NEW36RED
      111086452.91NEW36RED

       

       

      Now i need to calculate two things

      1. distinct count of cqctargetID upto that week,  I have tried creating a bar graphumbers  but now able to get the desired result.

      Result Should be : Week numbers on y axis. Distinct CQCTargetID on X axis. graph will have 3 bars for 3 weeks ( 34,35,36) with counts showing 3,5,8 respectively.

       

      Week 34 : FactID's 1,2,3 should be considered

      Week 35: FactID's  2,3,4,5,6 ( factID of CQCtargetID is repeated twice so we should take the MAX OF maxoccurflag into consideration.

      Week 36: FactID's 2,3,5,7,8,9,10,11 should be considered.

       

      2. The total avg of the distinct target ID upto that week.

       

      Can anyone help me on how to do the above calculations.

       

      Thanks in Advance.

       

      Balaji Prasad B