-
1. Re: Customer orders before and after ordering a specific product
swaroop.gantela Jun 29, 2016 10:17 AM (in response to Derrick Lang)Derrick,
This is a very round-about way to do this, very likely there are much cleaner ways.
But maybe this can be a starting point.
Mostly, it has a parameter to select an Item,
then it returns all the orders for customers that bought that Item.
Then previous Order ID is noted by:
IF ATTR([Item])=[SelectItem]
THEN LOOKUP(ATTR([Order ID]),-1)
END
with appropriate addressing and partitioning such that
index count is for each order restarting with each customer id
(see image below).
Then that is fixed across the Customer ID using
WINDOW_MAX([PrevOrderID])
with the same addressing and partitioning as above.
The same is done for the Next order.
Finally, a filter is used to show orders for previous, selected, and next.-
210117item.twbx 507.5 KB
-
-
2. Re: Customer orders before and after ordering a specific product
Derrick Lang Jun 30, 2016 6:18 AM (in response to swaroop.gantela)How about isolating those customers to remove all irrelevant customers? I only want to see all customers who have ordered that specific product.
-
3. Re: Customer orders before and after ordering a specific product
swaroop.gantela Jun 30, 2016 8:12 AM (in response to Derrick Lang)1 of 1 people found this helpfulDerrick,
Sorry, for not showing that in previous message.
I'm using a parameter to select the item, and then I compare that selected item to the Item dimension.
First,I get just the customers with the Item using [CustomWithItem]:
IF [Item]=[SelectItem]
THEN [Customer ID]
END
Returns Null for all those that don't.
On the table, Null comes up as a row, and I right-click and hide those.
Then for I fix that for all entries of that CustomerID:
{ FIXED [Customer ID]:MAX([CustomerWithItem])}
-
4. Re: Customer orders before and after ordering a specific product
Derrick Lang Jun 30, 2016 10:05 AM (in response to swaroop.gantela)Perfect! Thank you.