Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

qvd

Hi,

I have two qvd files and want to combine them to get the required data from both tables with a where clause in second qvd file.

Where clause will be "where [AccountNumber] = 'xyz'

can you please help me with the data load script.

thanks in advance

[Fact]:

LOAD [CountryName]

      ,[Geography]

      ,[AccountId]

FROM [lib://123/Fact.qvd]

(qvd);

[Account]:

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd]

(qvd);

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Table1:

LOAD

*,

[Asset]&'-'&[Date] as AssetDateKey

FROM DataSource;


Table2:

LOAD

*

FROM DataSource2

WHERE Exists(AssetDateKey, [Asset]&'-'&[Date] );


Hope this helps you.


Regards,

Jagan.

View solution in original post

19 Replies
oknotsen
Master III
Master III

[Account]:

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd] (qvd)

where [AccountNumber] = 'xyz';

May you live in interesting times!
Not applicable
Author

but i also want to join both table and get the data from both table where accnt no is xyz

reddy-s
Master II
Master II

Hi Prasanta,

You can use this as well:

load * inline [

Needed

XYZ

];

[Account]:

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd] (qvd)

where exists([Needed],[AccountNumber]);

If you need multiple values in the where clause, you can just add it to the inline table and they all will be included in the where clause. (Similar to an "IN" function in SQL)

Thanks,

Sangram.

oknotsen
Master III
Master III

add "join" between table name and the load statement:

[Account]:

join(Fact)

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd] (qvd)

where [AccountNumber] = 'xyz';

May you live in interesting times!
reddy-s
Master II
Master II

Hi Prasanta,

Then use the Left Join() or Left keep().

I would prefer Left Keep, since it gives good performance.

Thanks,

Sangram.

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

[Account]:

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd]

(qvd);

LEFT JOIN(Account)

LOAD [CountryName]

      ,[Geography]

      ,[AccountId]

FROM [lib://123/Fact.qvd]

(qvd);

Regards,

Jagan.

Not applicable
Author

Hello Everyone,

May be my question is not that clear.

actually i have multiple qvd files and the requirement as below.

In my main table (Table A), i have 11 lacs data in which i have my accountID based on which i will map and get the required data from other tables.

In table B, i have account name and account desc.

In table C, i have account location.

So the requirement is when account name is "XYZ" in table B, i want the related rows from table A, B and C out of 11 lacs total rows to be loaded into my app rather loading all 11 lacs rows.

this is something i have to join qvd files where account name is XYZ in table B.

Reddys310

Regards,

Prasanta

Kushal_Chawda

try this

[Account]:

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd]

(qvd)

where [AccountNumber]='xyz';

[Fact]:

LOAD [CountryName]

      ,[Geography]

      ,[AccountId]

FROM [lib://123/Fact.qvd]

(qvd)

where exists ([AccountId]);

Qlik will automatically create the join on [AccountId].

Not applicable
Author

Hi

Its seems like working.

but what will happen in case i reverse the order to table. as mentioned i have multiple table to add.

will it as below :

[Fact]:

LOAD [CountryName]

      ,[Geography]

      ,[AccountId]

FROM [lib://123/Fact.qvd]

(qvd)

where exists ([AccountId]);

[Account]:

LOAD [AccountId],

  [AccountNumber],

  [AccountName],

FROM [lib://123/Account.qvd]

(qvd)

where [AccountNumber]='xyz';