This is making me feel pretty stupid, lol. I’m trying to determine a list of customers who have not ordered from us in the last 18 months. So I’m writing an inquiry and using “@Today-500” but all that’s going to do is show sales from 18+ months ago.
I need to determine customers whose last placed order was less than or equal to @Today-500
I think I need to do some sort of “AND SOrder.OrderDate IS EMPTY between @Today and @Today-500 but not sure how to express that here.
So basically select * from CustomerID where lastorder is Less Than or Equal To @Today-500
Page 1 / 1
Hi,
I have some ideas as follows:
Join Customer table to Sales Orders with a Left Join (show all customers whether they have orders or not).
Aggregate/Group the results by Customer ID.
Add a Count field to the Results, to count # Sales Orders per customer. (Count sales order reference numbers.)
Add a Condition to select where the Count of sales orders is 0.
Add a range of dates to your Parameter and Conditions, so the GI is flexible to show any range of dates.
Laura
Hi,
I have some ideas as follows:
Join Customer table to Sales Orders with a Left Join (show all customers whether they have orders or not).
Aggregate/Group the results by Customer ID.
Add a Count field to the Results, to count # Sales Orders per customer. (Count sales order reference numbers.)
Add a Condition to select where the Count of sales orders is 0.
Add a range of dates to your Parameter and Conditions, so the GI is flexible to show any range of dates.
Laura
No caffeine yet but I’m slowly seeing what you’re doing here. Pretty crafty, going to try this now. :)
Hi,
I have some ideas as follows:
Join Customer table to Sales Orders with a Left Join (show all customers whether they have orders or not).
Aggregate/Group the results by Customer ID.
Add a Count field to the Results, to count # Sales Orders per customer. (Count sales order reference numbers.)
Add a Condition to select where the Count of sales orders is 0.
Add a range of dates to your Parameter and Conditions, so the GI is flexible to show any range of dates.
Laura
Hi Laura, the initial GI worked great -- I grouped/aggregated by customer, got the counts etc. Now it’s not returning anything after I put in the conditions and parameters:
I think the issue is -- how do I set the condition to get the count? The one I have highlighted above is obviously wrong, because I need to get the count of 0, not SOrder.OrderNbr = 0
Or is there a way to do some sort of conditional in the results grid?
Hi @swartzfeger were you able to find a solution? Thank you!
Hi @swartzfeger can you please provide a .xml of your current GI so I can take a look? Thank you
Hi @swartzfeger can you please provide a .xml of your current GI so I can take a look? Thank you
Hi @swartzfeger were you able to find a solution? Thank you!
Hey all, thanks for the followup -- have been slammed here at work and haven’t had time to investigate this further.
Here’s the sales aging report that I have so far.
Thanks for any input/suggestions you may have.
Hi @swartzfeger hope this helps!
Hi @swartzfeger hope this helps!
Robert this is INCREDIBLE! Thank you! I need to look at it to modify, as I want customers with 0 total orders to be listed as Stale instead of healthy but otherwise it’s perfect!
Hi @swartzfeger hope this helps!
Robert, what would be the best way to modify this so if total orders = 0, then STALE?
=IIF((COUNT(UAllOrders.OrderNbr])>0) And (COUNT(UOrdersAfterStaleDate.OrderNbr])=0),'STALE','HEALTHY')
@swartzfeger
Glad it helps, I would use this instead.
=IIF((COUNT(NAllOrders.OrderNbr]) > 0 AND COUNT(NOrdersAfterStaleDate.OrderNbr]) = 0) OR COUNT(NAllOrders.OrderNbr]) = 0, 'STALE', 'HEALTHY')
@swartzfeger
Glad it helps, I would use this instead.
=IIF((COUNT(TAllOrders.OrderNbr]) > 0 AND COUNT(TOrdersAfterStaleDate.OrderNbr]) = 0) OR COUNT(TAllOrders.OrderNbr]) = 0, 'STALE', 'HEALTHY')
THanks that did the trick… one more question if you have the time… for the row formatting I would like to do something like this:
But it’s turning everything yellow regardless of status… did I mess something up with the statement?
No, unfortunately using aggregate functions is not supported in style flags. For this you would need to build a view that returns the sudo-’Status’ value.
Vote on this idea and maybe we will see this implemented in the future!
No, unfortunately using aggregate functions is not supported in style flags. For this you would need to build a view that returns the sudo-’Status’ value.
Vote on this idea and maybe we will see this implemented in the future!
Ahhhh, that makes sense… thanks again Robert, I’m off to vote :)
No problem, try a shared filter on the GI of ‘Stale’ that has worked for me in the past as a substitute for styling aggregates!
Adding the style colors to an aggregate field is possible if you get the default Formula field name before you use a caption and substitute that value into the formula like this: =iif((Customer_Formulac5cd321184654a64a72057de20d51c25] = 'STALE', 'default', 'yellow')
Adding the style colors to an aggregate field is possible if you get the default Formula field name before you use a caption and substitute that value into the formula like this: =iif((Customer_Formulac5cd321184654a64a72057de20d51c25] = 'STALE', 'default', 'yellow')
@Fred Reiter
This is an awesome idea, I will test it out. Have you tried using this in the cell style and row style? I wonder if it works for both. Thanks for sharing!
Thanks for the above info.
I think the real question is, why is there no inbuilt sales history generic inquiry? This is one of main pages for other CRMs