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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
francesctesi
Contributor III
Contributor III

Function " where NOT Exists" to concatenate load

hi everyone,

to do an incremental load from a view on postgresql, I only process data from the last 7 days.

Then i would like to add with a concatenate load, all the rows which are not inserted in the QVD file.

I would like to use this script, but continue to give me error, because I do not enter any parameters in the 'NOT Exists' function.

//////

CONCATENATE LOAD
*
From [$(vQvdPath)/Exam.qvd] (QVD)
where NOT Exists ();

 

///////

The problem is that I never know exactly which field is different, as I do not have a key field.

Is it possible to do a check on the entire row to see if it exists, and if so add it to the QVD?

 

Labels (2)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

try with autonumber, something like


MyTable:
load
field1, field2,
AutoNumber(field1 &'|'& field2) as all_fields_key
;
// replace the inline load with a read from the postgres database (select .... from ...)
load field1, field2
inline [
field1,field2
2022-08-23,5
2022-08-25,6
2022-08-26,5
];

// replace the inline load with a read from qvd
CONCATENATE (MyTable)
load
field1, field2
inline [
field1,field2
2022-08-23,5
2022-08-25,6
2022-08-26,5
2022-08-26,5
2022-08-26,5
2022-08-26,5
2022-08-26,5
2022-08-26,500
]
Where
not exists(all_fields_key, AutoNumber(field1 &'|'& field2))
;

drop field all_fields_key;

// store MyTable into qvd

View solution in original post

2 Replies
maxgro
MVP
MVP

try with autonumber, something like


MyTable:
load
field1, field2,
AutoNumber(field1 &'|'& field2) as all_fields_key
;
// replace the inline load with a read from the postgres database (select .... from ...)
load field1, field2
inline [
field1,field2
2022-08-23,5
2022-08-25,6
2022-08-26,5
];

// replace the inline load with a read from qvd
CONCATENATE (MyTable)
load
field1, field2
inline [
field1,field2
2022-08-23,5
2022-08-25,6
2022-08-26,5
2022-08-26,5
2022-08-26,5
2022-08-26,5
2022-08-26,5
2022-08-26,500
]
Where
not exists(all_fields_key, AutoNumber(field1 &'|'& field2))
;

drop field all_fields_key;

// store MyTable into qvd

francesctesi
Contributor III
Contributor III
Author

thanks so much, it works!