Hi!
I have a dataset that includes region, units, sales, price and a fulfilment_date. I want to be able to calculate the 10th percentile of the sales in the previous 13 wks.
So far I have this calculation but I’m not able to make sure it’s getting the last 13 wks:
periodToDatePercentile({sales},10, {fulfilment_date}, WEEK)
How can I alter this to calculate the 10th percentile in the last 13 wks?
Hi!
Sorry for my delayed response. Sales is a column that is calculated by saying if the Item is A then use projected_sales_value, else if item is B, then use actual_sales_value.
Are you still working on this or were you able to find a solution?
You could try getting around the error by doing the following: percentile(ifelse(fulfilment_date >= addDateTime(-13, 'WK', fulfilment_date) AND fulfilment_date <= now(), {Sales}, NULL), 10, [fulfilment_date])