Hello! I have a financial report table:
tbFR('ID' text, 'Date' date, 'Company' text, 'Employee' text, 'Procedure' text, 'Value' decimal).
When generating the PDF, in addition to the list of all the records in the table (which I can do with a simple START and FILTER), I need to consolidate in another table the number of procedures per company, for example:
Date | Company | Employee | Procedure| Value
01/01 | A | John| Test A | 10
01/02 | A | Mike | Test A | 10
01/03 | B | Lara | Test B | 15
01/03 | B | Paty | Test A | 10
So, the consolidation table should show:
Company | Procedure | Quantity | Value | Total
A | Test A | 2 | 10 | 20
B | Test A | 1 | 10 | 10
B | Test B | 1 | 15 |15
Global Total: 45
Both tables (frames) should be in the same PDF.
I would like all this to always be in table format (tabular) and not, as I have seen in solutions to other problems, a list in loose lines on the page.
In the start expression's filter() condition, match the key to either minrow() or maxrow() of all records on the same table with both same company and procedure. That'll output only 1 row per unique combo. Then use SUM(SELECT())'s for the qty and value columns.
User | Count |
---|---|
34 | |
8 | |
2 | |
2 | |
2 |