This document will outline how to use the concatenate function in SQL reporting in Koha. This function will display specified fields in an SQL report in the same column.
How do reports display results as standard?
In a report that doesn't use the concat function each field will appear in an individual column.
How do results display when they have been concatenated
In a report that uses the concat function, fields that have been included in with the concat function will appear in one column and fields that are not linked with the concat function will appear in an individual column.
Why would someone what to display two entries in a report in the same column?
There are many reasons why it might be useful to display entries in the same cell. It may make information easier to read or the results may need to be downloaded to use in an external programme and having information side by side will make it clearer for the staff member working on the data.
How to add the concatenate function to a report
Identify the fields to be concatenated. Make sure the fields to be concatenated are side by side, in the order that they should display in the report results. This specific example will link the first name and second name columns into one column.
Type in CONCAT and an open, curved bracket i.e ( and then the first field to be included in the column. Put a comma next to the first field and then a double quote. Put a space and then another double quote and a comma. Finish with the second field to be included in the column and end with a closed, curved bracket i.e ) and end with a comma.
In this case, the two fields should be separated by a space, but there are other options for this.
The fields to be concatenated should be enclosed by rounded brackets.
A comma should be placed after the concatenated fields.
| Version | Date | Detail | Author |
| 1.0 | 26/06/26 | Document created | Holly Cooper |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|