Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
Would anyone can tell me the purpose/use of keep keyword. I read it you can use it JOIN/KEEP keyword where join will join and will show 1 table, KEEP keyword keeps 2 tables. my question is that why we would need KEEP keyword in real time?
Thanks.
Eg
If you have table 1 with 10 columns and 10K records and table 2 with 4 columns and 20 records.
In this case if you join the table2 with table1 then it will generate 10K records for the 3 columns in the table1 which is not feasible intend of that Keep just reduce the data in the table 2 in accordance with table 1 without joining and creating additional records
Hope this helps you
This has been discussed here: Re: KEEP command - why to use that?
read this thread
Understanding Join, Keep and Concatenate
There are many advantages of keep compared to join but it depends on the scenario:
It will avoid one to many relation wrong calculations,check here when to use Join and when to use Keep ?
its use can also reduce the table size.
Take scenario where u have master calendar with future date and there is one main data table.Its not recommended to join data with calendar, though you can associate but using Keep will also solve the purpose and also reduce the data size by comparing dates in main table.
hope it helps.
Sachin
One scenario that I commonly use is to reduce dimensions so that only the relevant dimension values get loaded 0 like this:
Transactions:
LOAD TransID,
TypeCode,
...
Left Keep(Transactions)
TypeCodes:
LOAD TypeCode,
TypeDescription,
TypeCategory,
...
But one could also use this for the same result:
Transactions:
LOAD TransID,
TypeCode,
...
TypeCodes:
LOAD TypeCode,
TypeDescription,
TypeCategory,
...
WHERE Exists(TypeCode)