
1. Re: Check if previous date is the same
Zhouyi Zhang Sep 11, 2018 10:36 PM (in response to Sophie HongDunnett)Hi, Sophie
What's the identity for the row (4/8 has two rows in your sample, there must be identity to distinguish them)?
ZZ

2. Re: Check if previous date is the same
Deepak Rai Sep 11, 2018 11:22 PM (in response to Sophie HongDunnett) 
3. Re: Check if previous date is the same
Sophie HongDunnett Sep 12, 2018 12:08 AM (in response to Deepak Rai)Thanks Deepak and Zhouyi.
Zhouyi, there are other dimensions but I am not sure how I could check whether the date are different.
Deepak solution will work. I could just create a calculate field for that and then use that for my if statement.
Thanks so much,
Sophie

4. Re: Check if previous date is the same
Sophie HongDunnett Sep 12, 2018 2:22 PM (in response to Deepak Rai)Hi Deepak,
The solution only work if there is no other dimensions on the table.
However, if there are, what can I use to differentiate whether the previous date is the same? In below example, if the date are the same then expected hours for the next date would be 0.
For example
Date Hours Work Expected Hours
1/8 8 8
2/8 8 8
3/8 5 8
3/8 3 0
4/8 4 8
4/8 4 0
5/8 8 8
6/8 8 8
Thanks
Sophie

5. Re: Check if previous date is the same
Sophie HongDunnett Sep 12, 2018 2:37 PM (in response to Deepak Rai)Hi again,
Just wanted to add that the Expected Hours is the dimension which I am trying to work out as above.
Thanks
Sophie

6. Re: Check if previous date is the same
Shinichiro Murakami Sep 12, 2018 2:48 PM (in response to Sophie HongDunnett)
table_calc_example_SM_10.5.twbx 16.1 KB


7. Re: Check if previous date is the same
Sophie HongDunnett Sep 12, 2018 6:09 PM (in response to Shinichiro Murakami)Thanks Shinichiro.
The Expected Hours is 8 for each date. The issue is when the Work Hours has been entered more once as example above. Therefore, the total Expected Hours for the day is end up double or triple which is incorrect.
Therefore, regardless of the number of times/rows the Work Hours have been entered, the Expected Hours for the day should only be 8.
From the solution above, you suggested that we added up the Work Hours to compute the Expected Hours. The Expected Hours should always be 8 regardless of how many hours the Work Hours has been entered.
Please let me know if this is still not cleared.
Thanks
Sophie

8. Re: Check if previous date is the same
Shinichiro Murakami Sep 12, 2018 10:18 PM (in response to Sophie HongDunnett) 
9. Re: Check if previous date is the same
Shinichiro Murakami Sep 14, 2018 12:36 PM (in response to Shinichiro Murakami)Just following up.
If you have further questions, please reply to this.
If you think problem is solved, please mark my answer as "helped".
Thanks,
Shin