Present Data from Two Data Sets in One Row
【Question】
I have two data sets like this:
=ds1.select(OrderID,OwnerArea==“NorthChina”)(A2) |
=ds2.select(OrderID,OwnerArea==“SouthWestChina”)(A2) |
What I expect is that the left part corresponds to ds1 and the right part corresponds to ds2 (as shown below), but it doesn’t work with the above code:
【Answer】
You can achieve what you want with an alternative:
A |
B |
C |
|
1 |
=ds1.count(OwnerArea==“NorthChina” |
Suppose the data in ds1 (NorthChina) is greater than that in ds2(SouthWestChina) |
|
2 |
=to(1,A1) |
=ds1.select(OrderID,OwnerArea==“NorthChina”)(A2) |
=ds2.select(OrderID,OwnerArea==“SouthWestChina”)(A2) |
A1 calculates the number of OwnerArea in ds1 and ds1 and the greater one will be used in A2’s expression – to(1,the one with greater number). Both B2 and C2 have (A2) at the end. The code is slow. To get it done faster, you can try using esProc SPL (Structured Process Language) to handle the data source and then present the result set in a report.
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_SPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL