I am looking at the user defined cell that holds an enumlist chosen by the user and want to return orders that have an order status that is in that list.
Below is an expression I use in another part of the app for a slice based on user input. (I think you told me how to do this by the way so this is for explanation purposes). It uses CONTAINS because the user defined cell has “prospect, active, barred” for example and it is comparing the text to see if the Outlet Rating is contained in that list.
CONTAINS(Filterlist[Outlet Rating],[Outlet Rating])
The expression we are looking to resolve is for a slice of a Customers table that has a child table with the relevant values in it which is why it’s getting complicated (for me anyway).
I could just slice the “orders” table but I want to run reports from it and I found it eaier to format the reports by going down the chain - customer - orders - order details - rather then up it from Orders to Customers (all the examples online go down the chain.)
Currently the user defined cell in “Running Sheet 2” is this below
||Exported To Xero , Open
The date part works fine as only ever one date will be selected by the user.
There are a number of orders on the day that I am looking at 19/12/2019 that all have “Exported to Xero” as the order status. I could change the first part of the expression to work in the same way as the second but that would only work if there was only ever one value chosen by the user. As above there are two “exported to xero” and “open”.
AND(COUNT( SELECT( Orders[Order Id],AND([_THISROW].[Outlet No]=[Outlet No],IN([Order Status], SPLIT(LOOKUP( [Unique ID],“Running Sheet 2”, “Unique ID”, “Order Status”),",")))))>0,
COUNT(SELECT(Orders[Order Id],AND([_THISROW].[Outlet No]=[Outlet No],[Delivery Date]=LOOKUP( [Unique ID],“Running Sheet 2”, “Unique ID”, “Delivery Date”))))>0)
The above expression only seems to return the orders with “exported to xero” if it is the first in the enumlist (which it is above) but an order with status “open” wouldn’t be returned. I also have “Open Unarchived” as a status option listed before “Exported To Xero” and if I check that then we lose an “Exported to Xero” returns.