Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Last store purchased in

Hi

I am trying to find the last store someone purchased from.

I use the following expression and I expect one store name to be returned. However, in some cases I get two or more.

concat({<Accumulator_Type={'RETAIL'}, [Order_Date.autoCalendar.Date]={"=max([Order_Date.autoCalendar.Date])"}>}distinct Order_Channel_Name)

Can you help?

George

6 Replies
qv_testing
Specialist II
Specialist II

Your expression correct...

=concat({<OrderDate={"=max(OrderDate)"}>}distinct DivisionName, ', ')

Anonymous
Not applicable
Author

Thanks for your answer

This will just add a comma between values. I don't want that. I want to make sure only one store name is returned.

qv_testing
Specialist II
Specialist II

Like this ??

=SubField(concat({<OrderDate={"=max(OrderDate)"}>}distinct DivisionName,','), ',', 1)

Anonymous
Not applicable
Author

Thanks again

I tried this and it takes the first of the "list" that concat creates I want to make sure that concat returns only one value. I try this with max(Date) because it means that no customer can make a purchase in the same day in two different stores. However, I still get two or more stores per person for max(date) being the last purchase date

qv_testing
Specialist II
Specialist II

can you share sample data ??

Anonymous
Not applicable
Author

Unfortunately no