Hello guys,
When I have table, lets say we named it TableA that contain these kind of records :
| Department | Transdate | Status | Error | Amount |
| HQ | 1/1/2022 | Posted | No | 10 |
| HQ | 1/1/2022 | Posted | Error | 10 |
| HQ | 1/1/2022 | NotPosted | Error | 10 |
| HQ | 1/2/2022 | NotPosted | No | 10 |
| HQ | 1/2/2022 | Posted | No | 10 |
| BS | 1/1/2022 | Posted | No | 10 |
| BS | 1/2/2022 | NotPosted | Error | 10 |
And I want to create a pivot table, and because it will be for a report, so I gonna need to insert the pivot table in another table, may I know how to do it, with X++ ?
I have to admit, I'm clueless what I'm gonna do about that record and what's needed to accomplish this in X++ select query.
So, the pivot will be like this:
| Department | Transdate | Status: Posted | Status: Not Posted | Error |
| | | Count | Amount | Count | Amount | Count | |
| HQ | 1/1/2022 | 2 | 20 | 1 | 10 | 2 | 20 |
| HQ | 1/2/2022 | 1 | 10 | 1 | 10 | 0 | 0 |
| BS | 1/1/2022 | 1 | 10 | 0 | 0 | 1 | 10 |
Basically, it will to capture and summarize, per Department and dates about :
1. How many are Posted and the amount
2. How many are Not Posted and amount
3. How many are Errors (provided it is posted or not), and the amount
Can someone help me ?
Thanks in advance.