In-Portal uses kDBList class for database table data retrieval and display. It can display:
- database fields (fields from current table)
- calculated fields (field expressions, that even could data form JOINed tables)
For example based on this database query:
SELECT main.FieldName, %1$s.FieldName AS OtherField, joined.FieldName2 AS FieldNameX
FROM table1 AS main
LEFT JOIN table2 AS joined ON joined.FieldA = main.FieldB
In example above FieldName is field from this table and FieldNameX is field name from joined table.
Wildcard "%1$s" can be used to reference main table (instead of specifying "main" each time). This works too.
This all breaks down, when:
- calculated field references other field from same main table using %1$s wildcard
- total value is displayed counted by that calculated field
Ready for testing.