Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey!
I need help to create an expression.
I have three tables, which i select from the database - Orders, Order_type and Clients.
1. First you have to insert right dates (I have calendars/sliders named date_range_start and date_range_end)
2. Now i want to know how many new orders i have for my order types (Starts in the date range and this client doesn't have any orders for two months ago) If client had an order for example three/four months ago then it's new order.
Result would be:
And I need to use EXPRESSIONS
So i tried to use set analysis but i don't know how to put it together.
I tried to get orders which start in the range, then subtract these (clients) who had orders in past two months AND NOW I HAVE TO SUBTRACT SOMETHING MORE OR CHANGE THE WHOLE COUNT, I don't know anymore
=Count({<START={"$(='>='& date_range_start& '<=' & date_range_end)"}>- <END={"$(='>='& MAKEDATE(year(date_range_start),MONTH(date_range_start)-2,day(date_range_start)) & '<' & date_range_start)"}>} OrderID)
I don't even know if I'm close to my solution or not. I have tried this so long now and I still don't have a solution.
I'm happy if somebody could help or guide me.
Your last post was very helpful, now i can see what orders it counts.
And it doesn't make sense, the function counts orders even from last year, it doesn't depend on my date range.
Yes, it shows only those clients orders who has END in the range but counts orders wrongly.
I think I got something that works now. I tried to use somekind a intersection.
=count({1<ClientID= p({1<Start={"$(='>='& date_range_start& '<=' & date_range_end)"}>} ClientID),
Start={"$(='>='& date_range_start& '<=' & date_range_end)"}>} DISTINCT OrderID)
Thank you so much!