I have a requirement where the data is as below.
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
Here create a parameter populated with the week filed and create calculated fields for current , prevoius and difference using the value selected in that parameter .
IF [Date] <= [Reference Date] AND DATEDIFF('day',[Date],[Reference Date])<=[ Desired date} AND DATEDIFF('day',[Date],[Reference Date])> 0 THEN [Random Value] END
Become a Viz Whiz on the Forums!
Support the Community and master Tableau.
Retrieving data ...