Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi *,
I have a salestable with these fields:
customer_id,
.......
order_date,
sales_amount
I'm trying to show (in a table chart) the customers where the last order is "older" (max(order_date)?) than 4 weeks. in these list customers with the last order older than two years shouldn't be shown. Can someone help me how to set this up? Thanks in advance.
Aloah
You may solve this in a calculated dimension like
IF(MAX(Order_Date) < Today() - 720, Null(), IF(MAX(Order_Date) < Today() - 28, 'No Order since 28 days', 'Active Customer'))
You only need then to tickmark "Suppress when value is Null" in the dimension.
HTH
Peter
Aloah,
First, it is convenient to have "customer last order" date. You can add it to your salestable:
JOIN (salestable) LOAD
customer_id,
max(order_date) as customer_last_order_date
RESIDENT salestable
GROUP BY customer_id;
Second, you can use calculated dimension, maybe like this
if(customer_last_order_date<=<criteria>,customer_id)
and use "suppress is value is null" for this dimension.
I'm not sure what is the "criteria" in your case. If it is last four weeks, it is:
today()-28
If it is last 2 years:
addmonths(today(),-24)
Thanks for your help. This helps a lot. Great.