Advanced Crosstabs for Studio Reports
Applies to: Kyvos Reporting
This section explores advanced examples that push the boundaries of crosstab capabilities in Kyvos Reporting. These examples illustrate how you can:
Use character fields as summary fields.
Display multiple summary fields in the same cell.
Apply conditional formatting.
Combine different summary functions.
Concatenate multiple values in a single summary field.
Use Case 1: Character Field as Summary Field
Scenario:
Display employee availability by shift and department. Department in-charges should appear in bold.
Required fields in the recordset:
DepartmentShiftEmployeeNameInCharge(Boolean or flag indicating in-charge status)
Steps:
Create an SQL query that retrieves and sorts the recordset (e.g., by
DepartmentorFacility).Create a condition (e.g.,
InCharge = true) and corresponding format (e.g., bold).Insert a crosstab on the Report Header.
Set:
Row header:
Department(Center-aligned)Column header:
ShiftSummary field:
EmployeeName
Apply the conditional format to the summary field.
Optionally, apply background colors to headers and summary cells for enhanced readability.
Use Case 2: Multiple Summary Fields
Scenario:
Show both planned and actual expenditure across branches and expenditure types.
Required fields in the recordset:
ExpenditureCodeExpTypePlannedExpActualExpBranch(e.g., US, NZ, AU)
Steps:
Write a query to fetch only service-related records.
Insert a crosstab on the Report Header.
Set:
Row header:
Branch(Center-aligned)Column header:
ExpTypeSummary fields:
PlannedExp,ActualExp
Apply conditional formatting as needed.
Hide row and column summary totals if not required.
Use Case 3: Different Summary Functions on Data and Totals
Scenario:
Display staff count by role and department. Show total salary in row and column summaries.
Required fields in the recordset:
DeptCdRoleCdEmployeeNoSalary
Steps:
Prepare the SQL query.
Insert a crosstab on the Report Header.
Set:
Row header:
RoleCdColumn header:
DeptCdSummary fields:
EmployeeNo(Set summary function to Count)Salary(Set summary function to Sum; mark Visible as unchecked)
Hide:
Row summary for
EmployeeNoColumn summary for
EmployeeNo
This setup allows you to show the count in the main matrix and the salary totals in the margins.
Use Case 4: Multiple Values in a Single Summary Field
Scenario:
Show sales rep name, sales amount, and a symbol (±) indicating performance versus target.
Required fields in the recordset:
ProductCodeZoneCodeSalesRepNameTargetedSalesActualSales
Steps:
Write an SQL query to fetch the required data.
Create a calculated formula (
M_Sign) using JavaScript syntax:if (ActualSales >= TargetedSales) return "+"; else return "-";Create a second calculated field that concatenates:
SalesRepNameConverted
ActualSales(to string)M_Sign
Insert a crosstab on the Page Header.
Set:
Row header:
ZoneCodeColumn header:
ProductCodeSummary field: Concatenated field
These advanced examples showcase the flexibility of Kyvos Reporting Crosstab reports in addressing complex reporting needs. You can combine textual summaries, conditional formatting, calculated fields, and multiple summary functions—all within the same component.