How to display two or more fields in the same cell of a report result

How to display two or more fields in the same cell of a report result


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.
Notes
For more details on how to find and view reports on your system, please check our Help Centre or ask us directly.

Notes
For more details on how to request a new report, please check our Help Centre or ask us directly.

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.

Notes
For details on how to customise the column header, please check our Help Centre or contact us directly.

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. 


VersionDateDetailAuthor
1.026/06/26Document createdHolly Cooper

























    • Related Articles

    • Overview of some SQL Report Functions

      Overview of SQL Report Functions This FAQ is an example of a simple report describing the “anatomy” of the SQL code used.  Details about the different functions are outlined in the table below the report.  Some functions are mandatory to use in order ...
    • The two most common SQL statements within Koha application reports

      This document will outline the two most common statements which appear in SQL reports run in the Koha application. SQL reports within the Koha application can only be run the return information that exists in the database, however, other SQL tools ...
    • What is a clause in a SQL report?

      In SQL a clause is a tool which allows specific parameters to be set on what results should be brought back in a SQL report. Examples of some of the clauses that can be used in SQL: CLAUSE WHAT DOES IT DO? WHERE A clause which filters results to ...
    • SQL Report Request Form

      How to submit an SQL report request The following are the steps of requesting a new SQL report to be created. 1. Log a ticket on the support portal to start the process. 2. Take a note of the ticket number. 3. Click the link below to be taken to an ...
    • How to Find and Run a SQL Report

      What are reports for? Reports are used to find and present data about the information on the system in a structured manner. Reports use SQL to ask questions of the Koha database. How to find reports on your system Go to the Reports module on the Koha ...