Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
My in my case one OrderId may repeat more then once and one Order may have more then one product.
About the Data Model :
Due to left joins both (OrderID and ProductID) do repeat couple of times.
Keep in mind, one order can not contain duplicate products. If the order has more then one product then they must be different products.
My fields are : [OrderId] & [ProductId]
How should I count total and avg (distinct) products ordered per order?
And how to add if condition in that expression like if [OrderDate] = Date(Today()) ?
Message was edited by: Lokesh Patel Second question added for if condition
Avg({<OrderDate = {'$(=Date(Today()))'}>}Aggr(COUNT({<OrderDate = {'$(=Date(Today()))'}>}Distinct ProductID),OrderID))
Avg(Aggr(COUNT(Distinct ProductID),OrderID))
or
Avg(TOTAL Aggr(COUNT(Distinct ProductID),OrderID))
and
SUM(Aggr(COUNT(Distinct ProductID),OrderID))
or
SUM(TOTAL Aggr(COUNT(Distinct ProductID),OrderID))
thanks, but just for knowledge.. what is the difference in both expressions?
Depends on where you are using..
If you use table, you have to use TOTAL...
If you use text box, you can use without TOTAL
Thanks and where can I add an if condition in that expression if i want to see only those orders where OrderDate = Date(Today())
Avg({<OrderDate = {'$(=Date(Today()))'}>}Aggr(COUNT({<OrderDate = {'$(=Date(Today()))'}>}Distinct ProductID),OrderID))