Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How select data from other TableBox?

I need show 2 TableBox on one Sheet.
1st TableBox (SelectingAllData) consists ALL data from one table.
2nd TableBox (SelectingDataByParams) will be include part data of 1st TableBox.
I would like implement changes for 2nd TableBox without full Reload data.
Help me plz.


SelectingAllData:
SQL SELECT fld1, fld2, fld3, fld4 FROM tblData;
// code below is wrong and it is my question
SelectingDataByParams:
SQL SELECT fld1, fld2
FROM SelectingAllData
WHERE fld3 >= $(Var01) and fld4 = $(Var02);


4 Replies
martin59
Specialist II
Specialist II

Hello,

You have to use the RESIDENT syntax :

<pre>SelectingDataByParams:
SQL SELECT fld1, fld2
RESIDENT SelectingAllData
WHERE fld3 >= $(Var01) and fld4 = $(Var02);

I hope that helps you
Martin
Not applicable
Author


This code raises error during Reload


Martin Favier wrote:
You have to use the RESIDENT syntax :
SelectingDataByParams:
SQL SELECT fld1, fld2
RESIDENT SelectingAllData
WHERE fld3 >= $(Var01) and fld4 = $(Var02);


But this my code Reloaded successfully


SelectingDataByParams:
LOAD *
RESIDENT SelectingAllData
WHERE fld3 >= $(Var01) and fld4 = $(Var02);


BUT I have got following message after Reload

SelectingAllData << tblData 1 591 833 lines fetched
SelectingAllData << SelectingAllData 3 183 666 lines fetched

and NO tables "SelectingDataByParams"

Why?

martin59
Specialist II
Specialist II

Sorry I had'nt take care to the SQL SELECT !

You load 2 tables strictly identical (same number of fields and same name of fields), QlikView see that and concatenate both.

So you can do this :

<pre>SelectingDataByParams:
NOCONCATENATE LOAD *
RESIDENT SelectingAllData
WHERE fld3 >= $(Var01) and fld4 = $(Var02);


or

SelectingDataByParams:
LOAD fld1, fld2
RESIDENT SelectingAllData
WHERE fld3 >= $(Var01) and fld4 = $(Var02);

But take care, you will have some synthetic keys.
Martin
Not applicable
Author


Martin Favier wrote:Sorry I had'nt take care to the SQL SELECT
.....
But take care, you will have some synthetic keys.
Martin




Thanks Martin!

I will try your code.

But what about dynamic refresh TableBox2 (with SelectingDataByParams) when I will change variables Var01 and/or Var02?

Will automaticlly reload data in TableBox2 (with SelectingDataByParams) or I need to do something (run macro etc.)?