Creating a report from multiple tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 08:01 AM
Hello,
I need to create a report, that will require data from at least 4 different tables. It was mentioned that I need to use/create a database view. I've never done this. Is this what I need to do? Or is there another way to display data from multiple tables without creating a database view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 08:11 AM
Reports can contain attributes from direct references to the table defined in the report. For example the incident table has a caller_id field that is a reference to the sys_user table. When you define the report you can include columns from caller's user record. So if the table you are wanting to report against has direct relationships to these other tables you may be OK without a database view.
But database views are required when there is no direct reference and the data needs to be joined via "where" clause.
Details on how to create database views can be found on Docs:
Please mark this post as helpful or the correct answer to your question if applicable so other viewing may benefit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 08:17 AM
What data do you need? Views join data but do not union data. If you are just joining, you should be able to dot walk (unless you are going through multiple M2M relationships but then your report will be odd anyway of if you have a doc id field).
If you need to union, you need to rely on the extension model and report on a common base class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 04:34 PM
Hi Adam,
Here are the conditions for the report.
There are 23 columns to the report. I can configure almost all of the columns by dot walking. Most of the fields are on the Case table and Account table. The only field/column I'm not getting a value for, is the State/Province (column name = state). It's actually from a related list on the Account (Locations) and is on the Location [cmn_location] table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2020 05:20 PM
Is this a related list or just a reference? Isn't this just account.location.state from the customerservice_case table?