Combining Tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 10:31 PM
I have two table i have common keys As Cloud in both the table but they are not primary key. How can i combine them. Is there any other way to combine to combine them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 11:25 PM
hi @sapnasarkar ,
A database view defines table joins for reporting purposes for more information refer Database view
Database View with Multlple tables tutorial
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:35 AM
Hi @sapnasarkar
For reporting purpose you can use the Database view and then use that datbase view in report.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 11:28 PM
looks like you want to combine tables for reports or to create virtual table.
Check this solution to combine two tables with common keys using Database Views. This will allow you to create a virtual table by joining multiple tables based on a common field, even if it’s not a primary key.
Create a Database View:
- Navigate to System Definition > Database Views.
- Click on New to create a new database view.
- Define the name and label for your view.
Add Tables to the View:
- In the Database View form, add the tables you want to join.
- Specify the join conditions based on your common key (e.g., the “Cloud” field).
Define the Join Conditions:
- Use the Condition Builder to specify how the tables should be joined.
- For example, you can join Table A and Table B where TableA.Cloud = TableB.Cloud.
Save and Test the View:
- Save the database view and test it by querying the view to ensure it returns the expected results.
If you like my response, please click on 'Helpful'.
Best,
PC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 12:45 AM
Table ...Order VariableprefixWhere clause
u_hcm_finops_gcp_forecast | u_hcm_finops_gcp_forecast | 100 | gcp forecast | ||
u_hcm_finops_gcp_daily_usage | u_hcm_finops_gcp_daily_usage | 200 | gcp daily usage | gcp forecast.Cloud = gcp daily usage.Cloud | |
u_hcm_finops_azure_forecast | u_hcm_finops_azure_forecast | 300 | azure forecast | gcp daily usage.Cloud = azure forecast.C... | |
u_hcm_finops_azure_daily_usage | u_hcm_finops_azure_daily_usage | 400 | azure daily usage | azure forecast.Cloud = azure daily usage... | |
u_hcm_finops_aws_forecast | u_hcm_finops_aws_forecast | 500 | aws forecast | azure daily usage.Cloud = aws forecast.C... | |
u_hcm_finops_aws_daily_usage | u_hcm_finops_aws_daily_usage | 600 | aws daily forecast | aws forecast.Cloud = aws daily usage.Cloud |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 12:46 AM
this is not working