Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

With DataSync, customers share data out to a database that can be queried by a multitude of reporting and analytics tools such as Tableau and Microsoft Power BI.

In some cases, customers will create database views by doing joins and unions of different tables replicated with DataSync to create reports and analytics to meet their business needs. Below are some example database view queries that you may find useful: 


Microsoft SQL Server

QueryUse Case


Code Block
languagesql
LEFT JOIN 

Below outlines the most commonly used Microsoft SQL Commands utilized with most Perspectium integrations:

JOIN

A Join statement is used to combine data or rows from two or more tables based on a common field between them. The table below outlines the join relationship between two tables and a brief explanation of the use cases.

QueryUse Cases
LEFT JOIN
[dbo].[sys_user] [sys_user] ON ([cmdb_ci].[assigned_to] = [sys_user].[sys_id])


View the users assigned to configuration items


Code Block
languagesql
LEFT JOIN [dbo].[task_sla] [task_sla] ON ([incident].[number] = [task_sla].[dv_task])


Incidents with their SLA


Code Block
languagesql
LEFT JOIN [dbo].[cmn_location] [cmn_location] ON ([incident].[location] = [cmn_location].[sys_id])


View incidents with location


Code Block
languagesql
LEFT JOIN [dbo].[sys_user] [sys_user] ON ([incident].[caller_id] = [sys_user].[sys_id])


View incidents with users by caller


Code Block
languagesql
LEFT JOIN [dbo].[sys_user] [sys_user] ON ([incident].[dv_caller_id] = [sys_user].[name])


For customers that prefer to work with display value fields instead of id. This will join the table based on display name


Code Block
languagesql
INNER JOIN `cmdb_ci` ON (`incident`.`cmdb_ci` = `cmdb_ci`.`sys_id`)


Detecting incidents that have CIs attached


Code Block
languagesql
LEFT JOIN [dbo].[task_sla] [task_sla] ON ([task].[number] = [task_sla].[dv_task])


View SLAs by parent task table grouping by display number