Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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);
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.
[Account]:
LOAD [AccountId],
[AccountNumber],
[AccountName],
FROM [lib://123/Account.qvd] (qvd)
where [AccountNumber] = 'xyz';
but i also want to join both table and get the data from both table where accnt no is xyz
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.
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';
Hi Prasanta,
Then use the Left Join() or Left keep().
I would prefer Left Keep, since it gives good performance.
Thanks,
Sangram.
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.
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.
Regards,
Prasanta
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].
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';