Hello everyone,
I have 3 record types. "Orders", "Products" and "Order Product Variations" (relationship).Orders (id, createdOn)Products(id, categoryId) *category must be equal to 5Order Product Variations (id, productId, quantity, createdOn)
I want to create an interface that shows which products are ordered for each day.
I want to ask what is the best way to proceed with this. This interface will be used by the Canteen Manager to prepare lunch orders for employees.
At a later stage I will try to show which employees ordered each food.
Case scenarios:
##########Case No1###################
Today: 23 Feb 2024 08:00 AM
1st list el:--------------------------------------------Orders for 23/02/2024
--------------------------------------------
2nd list el:--------------------------------------------Orders for 22/02/2024
##################################
###########Case No2##################
Today: 23 Feb 2024 09:31 AM
1st list el:--------------------------------------------Orders for 24/02/2024
2nd list el:--------------------------------------------Orders for 23/02/2024
3rd list el:--------------------------------------------Orders for 22/02/2024
Discussion posts and replies are publicly visible
Do you already have something? I mean, asking us to analyze your data structure and implement running code for you might a bit too much!?!
The code I have at the moment doesn't work for me as I want it. I tried this but data are not as I want them...
a!localVariables( local!lunchOrdersPerDay: a!queryRecordType( recordType: 'recordType!{43c0dc45-98e0-40cf-aae3-b85bfa2dfeee}ICOS Order Product Variation', fields: { a!aggregationFields( groupings: { a!grouping( field: 'recordType!{43c0dc45-98e0-40cf-aae3-b85bfa2dfeee}ICOS Order Product Variation.fields.{399b36b5-c6ae-4b9b-a144-3a4639dcab41}createdOn', interval: "DATE", alias: "createdOn", ), a!grouping( field: 'recordType!{43c0dc45-98e0-40cf-aae3-b85bfa2dfeee}ICOS Order Product Variation.relationships.{839da51e-c9d0-44c7-a17c-9cf842ac54d8}product.fields.{6dd1c941-3e1f-45c7-9a13-bfdc7e900d30}name', alias: "product" ), }, measures: { a!measure( field: 'recordType!{43c0dc45-98e0-40cf-aae3-b85bfa2dfeee}ICOS Order Product Variation.fields.{f264cc1d-2ee5-49b0-8645-76b6d4195e8c}productId', function: "COUNT", alias: "count" ) } ) }, filters: { a!queryFilter( field: 'recordType!{43c0dc45-98e0-40cf-aae3-b85bfa2dfeee}ICOS Order Product Variation.relationships.{839da51e-c9d0-44c7-a17c-9cf842ac54d8}product.fields.{fcd0f810-cba5-406a-9cf0-930e1718bcf2}categoryId', operator: "=", value: 5 ) }, pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5000) ) )
Not sure If I have to make multiple queries and adjust my data using for loops and variables.I get this as a result
[product:Chickpeas with spinach, count:1, createdOn:2/22/2024]; [product:Briam, count:1, createdOn:2/23/2024]; [product:Chickpeas with spinach, count:2, createdOn:2/23/2024]
Can you update your post and use this?