-
1. Re: Difference in date from different rows
Don WiseNov 27, 2018 9:50 AM (in response to Matt Huff)
Hi Matt,
Can you attach a workbook? Or mock data?
Thx, Don
-
2. Re: Difference in date from different rows
Matt Huff Nov 27, 2018 10:06 AM (in response to Don Wise)Sample Data attached
-
exampledata.xlsx 30.8 KB
-
-
3. Re: Difference in date from different rows
Norbert MaijoorNov 27, 2018 10:22 AM (in response to Matt Huff)
Hi Matt,
Find my approach based on lookup function as reference below and stored in attached workbook version 2018.2 located in the original thread.
1. M1. lookup Discharge Date: lookup(attr([Discharge Date]),-1)
2. M2. Lookup Medical Rec: lookup(attr([Medical Rec]),-1)
3. M3. Delta: if attr([Medical Rec])=[M2. Lookup Medical Rec] then datediff('day', [M1. lookup Discharge Date],attr([Admit Date])) END
4. Drag the required objects to the indicated locations and hide M2. Lookup Medical Record.
Hope it helps.
Regards,
Norbert
-
lookup2 nalmai version 2018.2.twbx 192.7 KB
-
-
4. Re: Difference in date from different rows
Don WiseNov 27, 2018 10:54 AM (in response to Matt Huff)
Hi Matt,
I just downloaded the data but the schema is not exactly the same as displayed in your original post?
Regardless, the attached 2018.3 workbook and below screenshot should help you along. If yes, please mark this response as correct. Thx! Don
-
Days Between Dates.twbx 58.7 KB
-
-
5. Re: Difference in date from different rows
Norbert MaijoorNov 27, 2018 10:47 AM (in response to Don Wise)
2 of 2 people found this helpfulHey Don,
Super efficient coding! Just for me or did i overlook something;) . Why should you set 0 for the last record of the pane?
Regards,
Norbert
-
6. Re: Difference in date from different rows
Don WiseNov 27, 2018 10:51 AM (in response to Norbert Maijoor)
Hi Norbert,
Good catch! That LAST() shouldn't be there!
Still recovering from too much tryptophan me thinks.
Thanks ! D
-
7. Re: Difference in date from different rows
Matt Huff Nov 27, 2018 12:12 PM (in response to Don Wise)Thanks so much!
-
8. Re: Difference in date from different rows
Don WiseNov 27, 2018 12:14 PM (in response to Matt Huff)
Hey Matt,
I know you marked my response as correct, but could you give Norbert a "This helped me' click too? He caught my error so he deserves a nod!
Thx , Don