Reputation: 319
I'm facing an issue with slow performance in this post: Slow performing triple Foreach with Parallelism taking up 40 minutes with LogicApps?, hence thinking of building the solution in a KQL query.
Situation: I have a Foreach Category within a Foreach of Products with a run time of 40 minutes. Basically it builds an HTML table for each Category, and within that category it places the Products together with the right Specialization.
Current setup:
The results are retrieved from Azure Log Analytics and stored in a LogicApp variable list which can be iterated. How can I build the above solution in to a KQL query?
Upvotes: 0
Views: 292
Reputation: 7618
If I understand the question correctly, you can solve it with one list containing the category, products and specialization, for example:
datatable(Product:string, Category:string, Specialization:string)
[
"p1", "c1", "s1",
"p1", "c2", "s1",
"p1", "c2", "s2",
"p1", "c1", "s1",
"p2", "c2", "s1",
"p2", "c2", "s2"
]
| summarize by Product, Category, Specialization
| order by Product asc, Category asc, Specialization asc
If the products, categories and specializations are in different tables use the "lookup" operator to join them together and then do the summarization followed by sort.
Upvotes: 1