Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Find end date of multiple intervals

lperetti
5 - Atom

Hello, 

 

The absence software gives me one absence per day, per ID and per absence reason.

I try for each id and each reason for absence to define what is the interval of absence to then be able to calculate an end date of absence.

 

For my workflow, I tried to set a number for each absence range by calculating a DateTimeDiff between row-1[date de début] and row [date de début], and if that result was less than -1 tell it to add me 1 to the range of absence.

 

From number 2 I already have 2 "Code Evenement" in the same range. 

I can't find any solutions.

 

Can anyone help me ? I attache my files to the post.

 

Best regards,

Léo

tempsnip.png

 

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

@lperetti ,

 

This data is VERTICAL.  If you use a SUMMARIZE tool, you could GROUP BY the desired field(s) and then get the MAX([Date ...]).   Then you could JOIN this data back to your incoming data and only get the record with the maxDate.  Otherwise you could join it just on the person and apply the max date to all records.

 

Does that make sense?

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
lperetti
5 - Atom

No sorry...

Can you attache a workflow please ?

For me, I can't define the MAX([Date ...]) if I have not already defined whether these dates follow each other and if they are part of the same absence ([Code Evenement])

AmalinaH
Alteryx
Alteryx

Hi @lperetti I tried making some adjustments to your workflow. I think part of the trick is getting the sorting right. I found it works to sort by IUP then Date then Event Code, rather than by IUP then Event Code then Date.

 

e.g. For lines 5 & 6 below, both absences occur on the same date but event code is different. Does this mean the count should still increase? If yes, then sort by IUP then Date then Event Code before applying the multi-row formula.

 

AmalinaH_0-1655996385064.png

 

I made some slight tweaks to your formula to group by IUP and account for whether the event code is different or not.

 

AmalinaH_1-1655996657555.png

 

Edited workflow attached. Does this bring you closer to what you were looking for?

lperetti
5 - Atom

That's perfect, thank you very much !  😀💪

Labels