8.8 Judge equality of sets when order is ignored
Here below is a monthly sales ranking table for the first quarter:
Find out the month that contains the top 3 products by total sales in the first quarter:
A | |
---|---|
1 | =E(‘A1:D10’) |
2 | =A1.groups(ProductName;sum(Sales):Sales).sort(Sales:-1).(ProductName)(to(3)) |
3 | return A1.group@o(Month).select(~.(ProductName).pos(A2)!=null).id(Month) |
A1: Convert the passed-in data to a two-dimensional table sequence.
A2: Calculate the top 3 products by total sales in the first quarter.
A3: When the number of set members is the same, using the pos function can judge the equality of sets in the case that the order is ignored.
Result: Mar
esProc Desktop and Excel Processing
8.7 Judge belongingness of sets when order is considered
8.9 Judging belongingness of sets when order is ignored
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/