Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mazdamiata
New Contributor

Inner Join in SQL format to Qlikview

Hi,

Im quite new in Qlikview and i have a simple inner join SQL script below:

How do i put this SQL inside Qlikview using OLEDB connection?

select a.customer, a.Operator, Date

From dbo.customer a

Inner Join

( Select customer, Operator, Min (Date) as Firsttransaction From dbo.customer

Group by customer, Operator) b

on a.customer = b.customer  and a.Date = b.Firsttransaction


Thanks


Mazda

1 Solution

Accepted Solutions
MVP
MVP

Re: Inner Join in SQL format to Qlikview

In your load script you can have this:

LIB CONNECT TO 'SQLDB';

SQL

select a.customer, a.Operator, Date

From dbo.customer a

Inner Join

( Select customer, Operator, Min (Date) as Firsttransaction From dbo.customer

Group by customer, Operator) b

on a.customer = b.customer  and a.Date = b.Firsttransaction

;

3 Replies
rajeshqvd
Contributor

Re: Inner Join in SQL format to Qlikview

Have you pulled tables from SQl...?

if it like

Table1:

Load *

From dbo.customer;

inner join

Table2:

Load *

From dbo.Operator;

MVP
MVP

Re: Inner Join in SQL format to Qlikview

In your load script you can have this:

LIB CONNECT TO 'SQLDB';

SQL

select a.customer, a.Operator, Date

From dbo.customer a

Inner Join

( Select customer, Operator, Min (Date) as Firsttransaction From dbo.customer

Group by customer, Operator) b

on a.customer = b.customer  and a.Date = b.Firsttransaction

;

mazdamiata
New Contributor

Re: Inner Join in SQL format to Qlikview

Thanks Petter!

Community Browser