Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Match tables from 2 sources

Hi guys,

can you tell me, how can I match tables from 2 sources ?

like:

T1: No,

     Name,

     FName,

     Amount,

     BDay

SQL ** FROM X;

T2: No,

     Name,

     FName,

     Amount,

     BDay

SQL ** FROM Y;

The difficult is to have disdtinct values because of the amount..

If I Join the via the No (Key), it +1 every values (controll with count(tablename))

I need both sources, because from source 1 are data from periode 1-2; and source 2 from periode 3-4;

but some data like no, name, ... are double (from s1 ans s2..)

hope you can help me

best regards

TM

7 Replies
Not applicable

Re: Match tables from 2 sources

hi

you can add a field to two tables for example

No,

Name,

FName,

Amount,

BDay,

'Period1' as Period

and tbale 2 'Period2' as Period

Best Regards,

MVP
MVP

Re: Match tables from 2 sources

if possible post a little example of your data (in excel, txt, qvw, ....as you want) and the output you want

sushil353
Honored Contributor II

Re: Match tables from 2 sources

Hi,

Do u want concatenation ?

It would be great if you attach sample source data and expected output.

HTH

Sushil

Not applicable

Re: Match tables from 2 sources

Hi,

If I understood well, you want to avoid duplicates, this is if No Key exists in Table X, you do not want to load the same No from Table Y. If this is the case, you can first load Table X and then use the WHERE NOT EXISTS(No) while loading Table Y.

Not applicable

Re: Match tables from 2 sources

how does it looks like in the script? can you give me an example pls?

Not applicable

Re: Match tables from 2 sources

I tried like:

T1: No,

     Name,

     FName,

     Amount,

     BDay

SQL ** FROM X;

left join

T2: No,

     Name,

     FName,

     Amount,

     BDay

SQL ** FROM Y where not exist(No);

but it doesnt work

I think my problem is, how to get the 2 sources in 1table of qlikview.. :s

s_kunte23
Contributor III

Re: Match tables from 2 sources

hi,

you can't join tables which are similar.

delete left join and Table Naming T2:, then it should work. also ensure that the field No is not loaded before in the script with exception in T1. If No is loaded somewhere else before in script not exists checks every previously loaded value, not only values of t1.

T1:

load

No,

  Name,

  FName,

  Amount,

  BDay

SQL * FROM X;

concatenate(T1)

load

No,

  Name,

  FName,

  Amount,

  BDay

SQL * FROM Y where not exist(No);

Regards

Stefan

Community Browser