Help setting up a database view on incident & record producer variables

leebooth
Kilo Expert

Hi all,

I've never created a Database View before, so bear with me.

I have some record producers that create 'u_private_incidents' and have many variables containing useful data.

The goal is to be able to create reports on these variables, without having to physically create/populate fields on the Incident record.

I found the following thread: Re: Reporting on Variables

So I know:

1 - The record producers store their values in the Question_Answer table & the 'table_sys_id' field matches the 'sys_id' of the corresponding 'u_private_incident' record.

2 - The variables themselves are stored in the Variable[item_option_new] table.

3 - Database views make it possible to link multiple tables for reporting purposes.

I've attempted many combinations of 'Where clauses' and just can't seem to get anything from the "try it" button. So i figured it's time to ask for some help.

Hopefully it's something simple I've not quite grasped.

find_real_file.png

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Lee,



You need to use item_option_new (Variable table). In order to get what you want you can use something as below



find_real_file.png


For testing I have taken Facilities_request table you can use u_private_incident table. Rest order, where clause remain the same.



Once done create a report on database view that was created with below columns & you get what is expected



find_real_file.png



If required you can then group the report by using Group by -- Number.


View solution in original post

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

Hi Lee,



You need to use item_option_new (Variable table). In order to get what you want you can use something as below



find_real_file.png


For testing I have taken Facilities_request table you can use u_private_incident table. Rest order, where clause remain the same.



Once done create a report on database view that was created with below columns & you get what is expected



find_real_file.png



If required you can then group the report by using Group by -- Number.


This was what I was looking for, thanks Jaspal!


Deepak Kumar5
Kilo Sage

Try this .


inc_sys_id=qst_table_sys_id


qst_question=var_sys_id


I was able to connect the variable table & filter out Variable Type's in my report thanks to the 'qst_question=var_sys_id' which clause.


Thanks Deepak!