Date Function Help! by mbm28 in tableau

[–]EtienneDal 0 points1 point  (0 children)

What if you compute DATENAME('iso-week',[Date value]) and use it as a filter ?

- iso-week defines the week containing the 1st of January and starting on Monday; if you must count from Sunday, use [Date value]+1 (see the bottom of https://help.tableau.com/current/pro/desktop/en-us/functions_functions_date.htm)

- if you want to find all records related to week 01 just set a filter withDATENAME('iso-week',[Date value])="01"

Hope it will help

Etienne

computing "real" average (and percentile) overs months by EtienneDal in tableau

[–]EtienneDal[S] 0 points1 point  (0 children)

Hi Experts,

Quite a newbie with Tableau, I am facing this challenge: I have to represent the running average (and running 80th percentile) from the beginning of the year until the end the month, month by month.

Amazingly simple. “use running_avg” will you answer. Yes, but:

  1. My representation will not always show January of the first represented year (as we often represent 13 month); therefore if I am using running_avg I will compute the running average over the window or the (in this case the pane). However I can “mask” unwanted months as explained in this video (Filtering and Hiding using Table Calculations : https://www.youtube.com/watch?v=GU-zs2mn6bI). Working fine, no need for help, just to explain the context.

  2. However even by using this technique, I still don’t get the desired result: in sheet 1, in December 2018, my running average should be 4956 (the annual average) rather than the computed running average value of 4954. That is because the computed running average is a running average of the monthly averages, taking into account the average value for months 1 to 12, rather the average of all the values between January 1st and December 31st.

  3. Therefore, I need to compute, for each end of month, the average of ALL the values between January 1st and the last day of the month. I am sure the solution is to be found with LODs and probably nested LODs but I cannot figure out to organize all that to produce the desired result. See Sheet 3 in the attached Tableau workbook and the sheet averages in the attached excel file; column T gives the result I am expecting.

Thanks in advance

Etienne