Difference between revisions of "Table/Column Alias"

From Hornbill
Jump to navigation Jump to search
Line 6: Line 6:
 
|- valign="top"
 
|- valign="top"
 
|style="width:73%"|
 
|style="width:73%"|
The following is a complete list of the Reproting "How To" guides, hints, tips and videos that have been created to aid in the configuration and usage of the system.
+
The following is a complete list of the Reporting "How To" guides, hints, tips and videos that have been created to aid in the configuration and usage of the system.
 
|style="width:5%"|
 
|style="width:5%"|
 
|
 
|
Line 19: Line 19:
  
 
==Table/Column_Alias==
 
==Table/Column_Alias==
Hornbill has quite a detailed reporting tool that allows users to gather information on requests logged for specific periods and according to Service Level Agreements.  
+
If you happen to create a report that extracts information from different tables such as the Assets, Requests, Asset Types tables, then you would have some fields with the same column names. This in itself is ok except if you are trying to read a report, you would confuse field names. This is where table and field aliases come in.
The wiki page https://wiki.hornbill.com/index.php/Report_Types has some useful information on the different types of reports and how to create them.
 
  
One request we had was a user who wanted to created a widget with count, and another with list of tickets which are about to breach in the next 2 days and are for specific tier tickets, owned by a specific team . The customer had written the query below and was getting no results even though there were some tickets which are due to breach in the next 2 days:
+
You could add an alias for a table such as h_cmdb_asset_types simply because the table name is very long and you wish to shorten it for reference elsewhere.  
  
 
[[File:TableAlias.PNG|600px]]
 
[[File:TableAlias.PNG|600px]]
  
The answer was to add one more condition to the WHERE clause which specified the request type and date range of two days as shown below:
+
The job of the fieldAlias is slightly different. In tables such as h_cmdbAssets you have a column called h_name. Similarly in table h_cmdb_asset_types, you also have a column called h_name so in order to create a report with these two tables, to avoid confusion, you can use field aliases to differentiate between the two fields.
  
 
[[File:FieldAlias.PNG|600px]]
 
[[File:FieldAlias.PNG|600px]]
  
 
[[Category:How To - Reporting]]
 
[[Category:How To - Reporting]]

Revision as of 12:52, 20 June 2018

Home > How To > Reporting > Table/Column_Alias

The following is a complete list of the Reporting "How To" guides, hints, tips and videos that have been created to aid in the configuration and usage of the system.

Related Articles

Table/Column_Alias

If you happen to create a report that extracts information from different tables such as the Assets, Requests, Asset Types tables, then you would have some fields with the same column names. This in itself is ok except if you are trying to read a report, you would confuse field names. This is where table and field aliases come in.

You could add an alias for a table such as h_cmdb_asset_types simply because the table name is very long and you wish to shorten it for reference elsewhere.

TableAlias.PNG

The job of the fieldAlias is slightly different. In tables such as h_cmdbAssets you have a column called h_name. Similarly in table h_cmdb_asset_types, you also have a column called h_name so in order to create a report with these two tables, to avoid confusion, you can use field aliases to differentiate between the two fields.

FieldAlias.PNG