How to get last date
Hi, I am new here!
I have a dataset that has data on multiple rows for the same patient with different encounter dates. I want to only see the unique patient once (so patient ID is the identifier) and show me only the most recent encounter date. Example data:
John Doe, Patient ID 1, encounter date 1/3/2022
John Doe, Patient ID 1, encounter date 3/5/2022
Jane Doe, Patient ID 3, encounter date 10/1/2022
John Smith, Patient ID 2, encounter date 3/1/2022
John Smith, Patient ID 2, encounter date 1/5/2022
John Smith, Patient ID 2, encounter date 6/4/2022
I have tried grouping methods in ETL and that hasn't worked. Can someone please help me?
Best Answers
-
Use a group by tile to group on the name / ID and then take the maximum of your date field.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
@ageibe You can do this with the Group By tile in Magic ETL.
In section #1 (select what columns identify the grouping) put your name and patient Id columns in that section.
In section #2 enter the name you want to give the most recent date column
In section #3 choose the encounter date column and then choose maximum for the aggregation type.
This will give you the most recent encounter date for each patient.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2
Answers
-
Use a group by tile to group on the name / ID and then take the maximum of your date field.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
@ageibe You can do this with the Group By tile in Magic ETL.
In section #1 (select what columns identify the grouping) put your name and patient Id columns in that section.
In section #2 enter the name you want to give the most recent date column
In section #3 choose the encounter date column and then choose maximum for the aggregation type.
This will give you the most recent encounter date for each patient.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
You guys are awesome! I was doing that but apparently I was missing a step. I was able to get exactly what I needed!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 302 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 633 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 760 Beast Mode
- 62 App Studio
- 42 Variables
- 699 Automate
- 181 Apps
- 457 APIs & Domo Developer
- 51 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 401 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 8 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive