-
1. Re: Tableau problematic weekend data
Jim DehnerJul 11, 2017 9:29 AM (in response to Belicia Teo)
Hi
Have you tried
if attr( DATEPART('weekday',([Order Date]) )) < 6 then sum([Sales]) ELSE PREVIOUS_VALUE(sum([Sales]))end - note you may need to adjust the weekend value of 6 , 7 for saturday and sunday - I am in the US
it will produce this
Let me know if this helps
Jim
-
sat sunday sales issue.twbx 1.2 MB
-
-
2. Re: Tableau problematic weekend data
Belicia Teo Jul 11, 2017 7:15 PM (in response to Jim Dehner)Hi Jim,
Thanks for the prompt reply. The new data is what I'm looking for, but I want to transform it into a line graph. So, is it possible to have Order Date as the x-axis and the corrected sales (Pick up Friday sales) as the y-axis? Could you help me with it? Will it show the corrected weekend data?
-
3. Re: Tableau problematic weekend data
Jim DehnerJul 11, 2017 7:20 PM (in response to Belicia Teo)
Try it. It should work. You may need to change the table calculations to
across from down but it may adjust when you place it on rows.
I will look at it,also in the morning
Jim
-
4. Re: Tableau problematic weekend data
Belicia Teo Jul 12, 2017 12:12 AM (in response to Jim Dehner)I've tried to use the formula provided by you. It works fine on most occasions. However, when I have null data for Saturday and Sunday, the formula doesn't work for these two dates. They show '0' instead. Currently, my sales follow a zn(Lookup(sum([Sales])) because I want to replace the null data with '0'. Could you kindly advise? Thank you Jim
-
5. Re: Tableau problematic weekend data
Jim DehnerJul 12, 2017 4:46 AM (in response to Belicia Teo)
-
6. Re: Tableau problematic weekend data
Belicia Teo Jul 12, 2017 6:50 PM (in response to Jim Dehner)HI Jim, I could not obtain the last screenshot. Could you attach the workbook for this?
-
7. Re: Tableau problematic weekend data
Jim DehnerJul 12, 2017 7:08 PM (in response to Belicia Teo)
What version of tableau do you have
-
8. Re: Tableau problematic weekend data
Belicia Teo Jul 12, 2017 8:57 PM (in response to Jim Dehner)Tableau 10.1
-
9. Re: Tableau problematic weekend data
Jim DehnerJul 13, 2017 4:27 AM (in response to Belicia Teo)
here you go
Jim
-
sat sunday sales issue.twbx 1.2 MB
-
-
10. Re: Tableau problematic weekend data
Belicia Teo Jul 31, 2017 12:27 AM (in response to Jim Dehner)Hi Jim,
Saw the workbook. It was really brilliant. What if there is completely no data for the missing dates? Could the formula still work?
-
11. Re: Tableau problematic weekend data
Jim DehnerJul 31, 2017 6:56 AM (in response to Belicia Teo)
I believe it will but check it out and see if it gives you the answer you need
Jim