Selecting the first of several customer references

thomash82948276

14-03-2019

Within my data a customer can have numerous activity IDs assigned to them.  They're assigned a new ID for each activity that they complete on our website.

Each activity ID has an activity date/time attached to it.  How can I add an activity ID as Additional Data within an enrichment that is the first activity ID of any given day?

Furthermore, a customer is also given an IdentityID

So the data would look like this.  How would I add only ActivityID 011d to the data within the workflow?

IdentityID
ActivityID
Activity Date Time
123011d03/13/19,12:00AM
123012s03/13/19,12:01AM
123013o03/13/19,12:02AM
123014pi03/13/19,12:03AM
123015uj03/13/19,12:04AM
123016mq03/13/19,12:05AM
123017hjk03/13/19,12:06AM
123018upo03/13/19,12:07AM

Accepted Solutions (1)

Accepted Solutions (1)

wodnicki

MVP

18-03-2019

Hi,

Select min(@identityId), min(@activityId), min(@activityDate) and then group by DateOnly(@activityDate).

NB this assumes @activityID is monotonically increasing.

Thanks,

-Jon

Answers (0)