Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Getting a count of consecutive days

Deano478
11 - Bolide

Hi Everyone,

 

I'm currently having an issue with a counter and i'm not 100% sure if this can actually be done or not but here its goes:

 

Essentially I have a list of staff members and their planned leave and what I want to do is based on the Leave_Date column I have a counter that will count how many days in a row somebody is off including the weekends. However the biggest caveat with this problem is that for whatever reason the dataset is missing weekends.

 

So I'm just wondering is there a way to create these missing weekends so that I can actually get an accurate count (This is what i think might not be possible to do).

 

Here is a dummy dataset similar to the real thing:

 

In this case this person should be off for 25 consecutive days however because of the missing weekends i'm only getting 16.

 

Any help at all is appreciated and if if this is simply impossible do let me know. 😀

 

NameIDLeave_DateLeave_TypeApprovalYearEmailConsecutive_Leave_Days
Dean Test1234512/05/2023Study Leave12023Dean.Test@Test.com1
Dean Test1234515/05/2023Study Leave12023Dean.Test@Test.com2
Dean Test1234516/05/2023Study Leave12023Dean.Test@Test.com3
Dean Test1234517/05/2023Study Leave12023Dean.Test@Test.com4
Dean Test1234518/05/2023Study Leave12023Dean.Test@Test.com5
Dean Test1234519/05/2023Study Leave12023Dean.Test@Test.com6
Dean Test1234522/05/2023Study Leave12023Dean.Test@Test.com7
Dean Test1234523/05/2023Study Leave12023Dean.Test@Test.com8
Dean Test1234524/05/2023Study Leave12023Dean.Test@Test.com9
Dean Test1234525/05/2023Study Leave12023Dean.Test@Test.com10
Dean Test1234526/05/2023Study Leave12023Dean.Test@Test.com11
Dean Test1234529/05/2023Study Leave12023Dean.Test@Test.com12
Dean Test1234530/05/2023Study Leave12023Dean.Test@Test.com13
Dean Test1234531/05/2023Study Leave12023Dean.Test@Test.com14
Dean Test1234501/06/2023Study Leave12023Dean.Test@Test.com15
Dean Test1234502/06/2023Study Leave12023Dean.Test@Test.com16
4 REPLIES 4
FrederikE
13 - Pulsar

Hey @Deano478,

 

I add all dates (in 2023) via data scaffolding and whenever a Saturday/Sunday follows a leave day it is also assigned as a leave day. 

 

FrederikE_0-1683716189918.png

 

ChrisTX
15 - Aurora

I came up with 22 consecutive vacation days, because I only counted Saturday and Sunday when Monday was a vacation day.

 

ChrisTX_0-1683721345618.png

 

 

ChrisTX_1-1683721395692.png

 

 

Chris

Christina_H
14 - Magnetar

Here's a way to do it in a multirow formula.

Christina_H_1-1683723019067.png

 

 

Deano478
11 - Bolide

Cheers for all the assistance guys I was able to adapt what you have thought me to get a fully scale-able solution in place now

Labels