#Tableau
ฝัง
- เผยแพร่เมื่อ 26 ส.ค. 2024
- In this tip, I take you through the 5 most common date functions in Tableau:
1. DATEPART
2. DATENAME
3. DATETRUNC
4. DATEADD
5. DATEDIFF
By the end of this video you will understand when to use them to meet your use case.
Here's a link to the cheat sheet - docs.google.co...
Amazing andy. such a blessing to the tableau community
Agree
You are underrated sir. I like your content.
Share away! That helped even more people learn. 👍🏻
Thank you Andy for the amazing introduction to the different date functions. I always used to struggle with date functions. Your video and cheat sheet really helps to simplify a lot of things. You are a gem 😊 Also, kudos to the video editing, it looks very refreshing and cool 👍😊
Thank you.
Thank you so much!! Was looking for help with date diff for so long and this was by far the most straightforward and helpful explanation
Great to hear!
Thank You Andy 🙂
My pleasure!
Thank you for this video, great explanation as usual )
To make calculation based on integer comparison is better to use DatePart - always returns Integer
Task Case: Select all the orders with the ShipDate after 10th of each Month:
// iif([DateName_Day] > 10,'Ship after 10th','Other') // >> returns mistake message - can't compare string and integer values
// until type conversion will be applied:
// iif(INT([DateName_Day])>10,'Ship after 10th','Other')
// While DatePart works well from the start:
iif([DatePart_Day]>10,'Ship after 10th','Other')
Yes that’s correct. In the video I say datepart returns an integer and datename returns a string.
Cheat sheet is a simple and powerful way to communicate. Great idea.
This channel deserves at least a million subscribers
Spread the word! 😊
Hats off to you!
Thanks Andy
For the DATEDIFF Days Delayed example, I think you said the the logic backwards (starting around 8:10). It looks like the first order was actually shipped 1 day early (on September 18, 2021 instead of September 19, 2021), not delayed by 1 day.
On the third line, the product was expected to be shipped September 20, 2021, but was not shipped until October 6, 2021 (making it delayed by 16 days).
** I am still trying to learn so please correct me if I am wrong, but I want to make sure I am comprehending correctly.
Thanks for all your work, Andy!
Then in the final calculation for "which weekdays have the most delays", it seems you used the logic of negative days = delayed orders, which is what I was thinking.
Thanks andy , for yr great efford, labour , u are the blessing of people that standing in the last of the row . Made by abs( ❤❤❤) . #india .
Thank you
Thank you Andy for this very interesting video 😀 mastering dates is so important in Tableau, your help is really appreciated
My pleasure.
Amazing video, thanks a lot Andy. I feel much more confident to use them now😊
Yay!!
Thanks .... Once again Andy Very well explainedd !
Very welcome
Andy, thank you!
Great channel and amazing advices)
Andy, this is very helpful! Can you address how or if the values would change if you change the Fiscal Year Start feature to say October? Or how to otherwise manipulate the dates vis-à-vis a Fiscal Year. Thank you!!
Andy your best tutor , thank you somuch
I appreciate that 👍🏻
Thanks Andy! Your videos are great!
My pleasure!
That cheat sheet is awesome!!!
Thank you. I’m glad you find it useful. 👍🏻
Awesome Andy 👍🤞
Really nice video Andy! It's getting a bit more complicated when we want to exclude weekends.
Very helpful!! Question: shouldn't the "Is Delayed" calculated field be > 0 and not less than?
I also have the same question
Could be. Either way, you get the idea.
@@vizwiz i have been following u for a long time and i look forward to ur videos. Watever i have learnt in tableau its all bcoz of u. I adore ur technical skills and i tell this to everyone. Keep making videos and help us to be good at it.
Thanks a lot! This was helpful!
Hi Andy, amazing video. Is there a method I can use to control say order date and return date using a single date parameter? I want to do a count of both orders and returns using the corresponding date field but using a single date parameter. Many thanks
Awesom
Thanks Andy! Great video. Can you do a simple LOD vs window_functions video?
What do you mean? What’s the use case?
Thanks for the video. But cheat sheet is not accessible any longer.
Fixed! docs.google.com/presentation/d/1j-GiwmWOhSCF4GqHfM-M3910OjrXWTL9/edit?usp=sharing&ouid=109813978585042026440&rtpof=true&sd=true
Thanks for this helpful video. This is exactly i what I wanted... I struggle a lot with date functions. Could you please make a video on MAKEDATE and how to create a date field when we don't have any date . Kindly help me on this
Makedate needs three numbers passed to it. Year,month,day. So if you want to make up a date, you could have MAKEDATE(2022,9,1) to get September 1, 2022
@@vizwiz Thanks a lot ... 👍
I have a data source that shows the MONTH Column in integers. So when I tried to use the Calculated Field DATENAME('month', MONTH) it converts to DATENAME('MONTH!,MONTH) and it won't change the month numbers to month names. Why is that?
Because the second part of the function requires a date field. Have you tried makedate to change your month # to a date?
Hello !. Amazing as usual. But one thing caught my eye. The datepart - Week is shown as 38, however, as I checked my outlook calendar shows week num as 37. Please shed some light on this.
Your starting day of week is probably Sunday. Mine is Monday.
What is Start of week in datepart function?
Datepart(‘day’,[Date]) = 0
If I may say one thing, it would be nice if everything done was a tad slower. Between the quick talking and fast movement and clicks, its difficult to follow.
Got it 👍🏻 Thanks for the feedback. The more recent videos should have a better pace.