SOLVED
Multi Field Combination for Mix / Max Date
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
kpurcell
6 - Meteoroid
‎04-30-2015
12:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I was hoping if someone could help if there is an easier way to do this.
I have a table with userid, activity code and activity date stamp. Is there a formula that would give me min activity date and max acivity date for each uniquie userid, activity code for each day. For example
Any help would be greatly appreacited.
Kevin
I was hoping if someone could help if there is an easier way to do this.
I have a table with userid, activity code and activity date stamp. Is there a formula that would give me min activity date and max acivity date for each uniquie userid, activity code for each day. For example
userid | activity | activity date stamp |
1 | pick | 3/1/15 9:00 AM |
1 | pick | 3/1/15 9:15 AM |
1 | pack | 3/1/15 11:15 AM |
1 | pick | 3/2/15 11:15 AM |
1 | pack | 3/2/15 11:15 AM |
3 | pick | 3/1/15 9:00 AM |
3 | pick | 3/1/15 9:15 AM |
2 | pack | 3/1/15 11:15 AM |
2 | pick | 3/2/15 11:15 AM |
4 | pack | 3/2/15 11:15 AM |
Any help would be greatly appreacited.
Kevin
Solved! Go to Solution.
Labels:
- Labels:
- Preparation
- Transformation
2 REPLIES 2
kane_glendenning
10 - Fireball
‎04-30-2015
01:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Kevin,
To do this, you probably want to use a Summarise tool. The Prep work that will be needed is getting a field for each day. The summarise tool will do the min/max, and then a join tool will append to the original data if that was required.
A formula tool with the following will give you the Day field ?DateTimeTrim([Activity Date Stamp],'day')
The Summarise tool will just need Group By: UserID, Activity, Day, Min (Activity Date Stamp), Max (Activity Date Stamp)
If you want to append your results back on, then use a Join tool on all the relevant fields to append the Min & Max fields.
Kane
To do this, you probably want to use a Summarise tool. The Prep work that will be needed is getting a field for each day. The summarise tool will do the min/max, and then a join tool will append to the original data if that was required.
A formula tool with the following will give you the Day field ?DateTimeTrim([Activity Date Stamp],'day')
The Summarise tool will just need Group By: UserID, Activity, Day, Min (Activity Date Stamp), Max (Activity Date Stamp)
If you want to append your results back on, then use a Join tool on all the relevant fields to append the Min & Max fields.
Kane
‎04-30-2015
01:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you Kane. I will try that approach.
Kevin
Kevin
