Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
balrajahlawat
Champion
Champion

What is the Keep advantage over Join?

Hello, I know Join will merge the result into one table and Keep will reduce the table on the basis of condition and will not merge into one table.

But in which scenario Keep is used and where it will be helpful and how?

I will appreciate if anyone can expalin with example.

Regards,

Raj

9 Replies
advait_thakur
Creator III
Creator III

Dear Balraj,

As far as Join concern, you have answered your own question.

Keep is used in many scenarios and has good advantages.

In keep Tables are never join, it is based on intersection of table data. Most importantly it will get store in QlikView separately. In join, both tables will get store with one name in QlikView.

The keep functionality reduces the number of cases where explicit joins need to be uses.

Regards

Advait 

Join the official Qlik Enthusiast's page here
https://www.linkedin.com/groups/6513382/
jaswantc
Creator II
Creator II

Yes As you sad Keep will apply condition on source tables.

Ex:Lets take example , I have datamodel that contains fact with Sales for Dept A, B, C & D and Department qvd might contains departments A to Z and in this case we don't need to load other than A, B, C & D departments and hence we can use

DEPT:

Left Keep(Fact)  ==> This will reuce Unwanted dept from dept qvd and load required dept.

Load   *

From Department qvd.

IamBack
Champion
Champion

using join there may be situation where your data get increased.

ex:  for ID 1 in One table with one row and same ID I with 2 rows in second table .and if left join first table with second then result will have two row.but if you do left keep

then it will have 2 seperate table . do same task as join. and no of row are still as original in first table.

so in those cases where you dont want to increase no of duplicates in first table we can have two seperate table.

i.e you can use keep.

Hope this make sense

Sunil

Sunil Chauhan
maxgro
MVP
MVP

from qlikview en espanol blog

keep.jpg

join.png

its_anandrjs

Hi Balraj,

In different scenarios the Joins is used and keep also if using keep the separate table is maintain. It is also used to reduce the data. Suppose in any join the data get increases in the resulting table after join suppose we don't need this in this case a separate table is used.

HTH

Thanks & Best Reagrds

Anand

Not applicable

hi Jaswant ,

Can u please provide With example DATA So we can understand clearly

balrajahlawat
Champion
Champion
Author

Anand,

It's obvious that after performing Join your data gets increase into result table.

Then what is the advantage of maintaining increased records into a seperate table?

Regards,

Balraj

balrajahlawat
Champion
Champion
Author

Advait,

If Keep does'nt store in QV then where it goes? As we know QV is in memory tool and use RAM then in case of Keep where QV store the Keep records?

And after keep, records are maintained into 2 seperate table. Same thing we can store in one table using join.

Then why we are maintaining 2 tables?

Regards,

Balraj

jaswantc
Creator II
Creator II

Hi Qliklearn,

See attached example,

In 1st set of load Student_Information Dimension loaded with all Students (7 records).

In 2nd set of load it loaded only Students matched with fact(That way you can load only required data and can save memory usage by eliminating unwanted data)

Run below sample code and see data in table viewer.

 

StudentRecord:

LOAD * INLINE [
Student ID, %Marks
99ECE04, 78
99ECE02, 67
99CSE33, 81
99MCH27, 64
]
;

Student_Information:
LOAD * INLINE [
Student ID, Student Name
96ECE41, Peter
99CSE33, Jams
99MCH27, Kevin
01ECE32, Rob
02ECE12, Mary
11ECE40, Peggy
06MCH37, Carol
]
;



Fact:
LOAD [Student ID] as ID,
%Marks as [% Grade]
Resident StudentRecord;

Dimension:
left Keep(Fact)
LOAD [Student ID] as ID,
[Student Name] as StudentName
Resident Student_Information;