2 Replies Latest reply on Feb 22, 2016 7:01 AM by Shinichiro Murakami

# Is there a efficient way to find out networkdays in tableau?

Hi All,

I am in need of a function or logic which calculates the difference between two dates without considering weekends (i.e Saturday and Sunday).

Like in Excel we have Networkdays function, we donot have a such an alternative in Tableau.

Kindly let me know if there is a suitable workaround.

Rahul.

• ###### 1. Re: Is there a efficient way to find out networkdays in tableau?
1 of 1 people found this helpful
• ###### 2. Re: Is there a efficient way to find out networkdays in tableau?

The link was long discussion, and I put something here for my better understandings.

Might have some error, though.

[Weekday Only]

((if datename('weekday',[Date2])="Sunday" then [Date2]-2

elseif datename('weekday',[Date2])="Saturday" then [Date2]-1

else [Date2] END)+1

- (if datename('weekday',[Date1])="Sunday" then [Date1]+1

elseif datename('weekday',[Date1])="Saturday" then [Date1]+2

else [Date1] END))

-

int(((if datename('weekday',[Date2])="Sunday" then [Date2]-2

else [Date2] END)+1

- (if datename('weekday',[Date1])="Sunday" then [Date1]+1

else [Date1] END))/7)

-

int(((if datename('weekday',[Date2])="Saturday" then [Date2]-1

else [Date2] END)+1

- (if datename('weekday',[Date1])="Saturday" then [Date1]+2

else [Date1] END))/7)

Thanks,

Shin

9.0 attached.

1 of 1 people found this helpful