Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have table of orders and fields 'order date','order reference','customer id'
I need an expression that gives me how many distinct customers (customer id's) have placed an order each day (order date), but have also placed at least one order in the past x number of days...
Can anyone help me out?
Thank you!
Darren
I can make it only in the script, Unfortunately it will not be dynamic )-:
See attached file
Hi Darrn
Do you want the x number of days to be dynamic?
Anyway, If you could attach your qvw file it will be easier to assist you.
Hi, sorry I can't add the qvw. Would the expression be different if I wanted it dynamic? Couldn't I just replace the constant with a variable? Do you know what the expression would be if I wanted it as, say, 365 days...?
Thanks
My suggestion is to add a flag to each customer identifying that he has placed an order
in the last x days. This will be in the script level.
Lets call it: CustomerPlacedOrderFlag
Then add a simple expression:
Count({<CustomerPlacedOrderFlag = {{'1'}}>} Distinct Customer)
Hope that helped
Ori
Thanks Ori, I'm not entirely sure how I would build that in to the script? Is there no way of making it dynamic if I needed to?
I've attached a very brief example and a description of what I want to achieve
Hope it makes sense...
Thank you!
I can make it only in the script, Unfortunately it will not be dynamic )-:
See attached file
Brilliant, thank you very much for your help
Your welcome (-:
Just mark as "Correct Answer" so other people could enjoy from this answer.
Ori