How to join 2 tables thru Query Builder and show all records with or without relationship

Daisy Licup
Kilo Contributor

Hello Experts,

Need help from you. I am creating report thru CMDB Query Builder. I am connecting 2 CMDB tables but not all records are showing. For example, I want to show all records in Table A "with" or "without: mapping/relationship with Table B.

When I select "Any relationship" from query builder, the result will only show rows 1 and 3.

But my goal is to shall all 3 records.

Sample Records

#  TableA.Field1   TableB.Field1
1  Value ABC  A123
2  Value XYZ  
3  Value XXX  B987

Appreciate your expert advise on this. Thank you.

6 REPLIES 6

Hi @Daisy Licup ,

Yes "Admin" role is required to create database view record. I don't think so is there any other way to combine two or more tables other than database view.

Also watch below youtube video.

Reporting from Multiple Tables

Regards,

Harshal.

the-deep
Tera Contributor

Hi Daisy,

 

Replying to an old post but I'm also putting this here for my future ref too as I have just spent the evening working out a similar issue.

 

Add your second table a second time, so that your diagram shows

 

TableA 1

TableB 1

TableB 2

 

You already have a relationship link from TableA 1 to TableB 1

Add another relationship link from TableA 1 to TableB 2

 

This will create a fork with a default AND.

Change that to an OR.

 

Now define the relationship between the OR and TableB 2 as 'No Relationship'

You will see the asterisk disappears on that line and there is also no label as there is no Relationship.

 

See attached example - see the relationship lines with no label.

 

I hope that helps.

 

Nick