The custom column feature allows users to create a separate derived column which could be required for creating reports. This is useful when the data is required in a different format or there is some custom calculation which is required. In custom column we can write SQLFunction (as long as it returns a single column of values), arithmetic functions, logarithmic functions, static values, case statement etc.
In this below blog we are covering an example. We have ‘date time’ values in the database. Now, we want to extract date from the date-time values, then using custom column we will use the SQLfunction to extractdate and mention the columnname on which we are applying this.
Following are the steps to create a custom column:
Step1: First click on Columns then click on the down arrow as shown in the below image then click on the “Custom Column”
Step2: A window will appear in which the user can give a name to the column and write the SQL query to get the output. The custom column name should not be a reserved keyword of SQL as well as should not be same as any other column name which are part of the report.
Step 3: Click on save and then ‘Generate’
Note: You can also put static values here. You can basically write anything here which will result in a single column of values. Directly write your DB function/arithmetic function etc. There is no need to write select, alias, where, having, etc clauses here. Also, you can refer to various columns from various tables from the DB in the custom column.
Note that in case if you are calling a column of the DB make sure it is a fully qualified like tablename and column name both should be present.
Thank You,
Helical Insight