Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
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

Labels (1)
6 Replies
Nagaraju_KCS
Specialist III
Specialist III

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.

Nagaraju_KCS
Specialist III
Specialist III

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

Nagaraju_KCS
Specialist III
Specialist III

can you share sample data ??

Anonymous
Not applicable
Author

Unfortunately no