Skip to main content
Level 2
Feb 23, 2023 5:38 AM UTC
Solved

Writing a Query for Dates to pull most recent first anfd ignore the rest

Hello Everyone,

I'm attempting to create a query for the workflow in which I must use the data of the customers who have purchased vehicles and then focus on a specific group of customers who have recently purchased vehicles.

Example: I owe four vehicles for a specific brand, but I only want to see the most current one depending on when they were sold, disregarding the other three.

Can someone quickly support me with this?

Thanks in Advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sreevarshini-P
Sreevarshini-PAccepted solution
Level 2
Feb 23, 2023 12:51 PM UTC

Hi @umav ,

 

 

First pull all the customers in the query and then try using deduplication 

For further reference you can go through the documentation Dedup Doc 

 

 

6 replies

Shubham_Goyal__
Level 6
Feb 23, 2023 5:48 AM UTC

Hi @umav ,

 

You can use the 'Split' activity after your Query activity to Limit the records depending on certain criteria (@purchaseDate or @soldDate may be in your case). Here you can select the column from the table and sort it in Descending order and then limit the max size to 1 and you will get the latest car that was sold/bought by that customer.

Link for more info on 'Split' activity.

 

 

Br,

Shubham

 

Translate
~Thanks - Shubham Goyal (Enterprise Architect)
UmaVAuthor
Level 2
Feb 23, 2023 5:50 AM UTC

Updated:

Hi @shubham_goyal__ 

Many, thanks for the quick response, let me give a try and let you know on it.

can you please let me know what to choose over here? and the concept of choosing them?

 


Thank you!

Translate
Sreevarshini-P
Sreevarshini-PAccepted solution
Level 2
Feb 23, 2023 12:51 PM UTC

Hi @umav ,

 

 

First pull all the customers in the query and then try using deduplication 

For further reference you can go through the documentation Dedup Doc 

 

 

Translate
UmaVAuthor
Level 2
Feb 23, 2023 1:19 PM UTC

Many thanks, Sreevarshini

This worked the way I expected😊

Translate
Sreevarshini-P
Level 2
Feb 23, 2023 1:33 PM UTC

My Pleasure 😊

Translate