Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Connecting different tables

Hi,

I'm new about QlikView, just working on it few days.
I'm trying to connect to a SQL Server 2008 database, and configuring a simple sheet to navigate through some data.

In the database I have some table, suppose :

Company with company_ID and company_name column

and

Branche with branch_ID, branch_name and branch_companyID

What I want is to put on the sheet two ListBox with company_name and branches_name and when I click on a company I want to automatically select all the related branches.

I have created the two Listbox but when I select the company no branches are selected...how can I set this relation ?
I thought QlikView shows the database relation diagram and reflect all the relationships but I suppose it works in other way.

Thanks for your help.

Bye

4 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

you need to name your join keys identically, to create a link. In your case, rename branch_companyID to company_ID (case-sensitive!) and you'll se ethe data linked. Something like this:


SQL SELECT
branch_ID,
branch_name,
branch_companyID as company_ID
from branches;


good luck!

Oleg

Not applicable
Author

Sorry I can't understand.

This is a part of the database DDL of the tables "Company" and "Branches"

Company table

CREATE TABLE [dbo].[tblCompany](
[company_guid] [uniqueidentifier] NOT NULL,
[company_name] [nvarchar](50) NOT NULL

)

Branches table

CREATE TABLE [dbo].[tblBranches](
[branch_guid] [uniqueidentifier] NOT NULL,
[branch_name] [nvarchar](3) NOT NULL,
[branch_company] [uniqueidentifier] NOT NULL

)

In SQL SERVER 2008 I make a JOIN with something like this :

Select * FROM tblCompany INNER JOIN tblBranches ON company_guid=branch_company

What I have to do to connect those two tables in QlikView ?

Thanks a lot

Not applicable
Author

Ok,

I have understood now but is this (renaiming foreign key) the only way to connect data ?

There is no way to let QlikView import the "SQL Server Database Diagram" that stores all these information yet ?

thanks

sczetty
Partner - Contributor
Partner - Contributor

Nope, this is the only way to do it. Since QlikView can bring data in from numerous sources into a single application, this is the only way to assure that all data sources can be connected based on the appropriate key structure.