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: 
Not applicable

check if there is a record

Hi,

I've got this statement:


TABLE:
LOAD
BMENG AS OrderIntake
,'$(vDatum)' AS Datum
FROM [some.qvd] (qvd)
WHERE [Vorige datum_VDATU] = '$(vDate)'


If this date doens't exist I still want to add this date but with OrderIntake as 0.

Is this possible? If Yes how?

Thanks in advance.

Rey-man

3 Replies
Not applicable
Author

Hello Rey-man,

Try this code along with your existing code:


concatenate(TABLE)
Load
0 as OrderIntake,
'$(vDatum)' as Datum
from qvd
where not exists([Vorige datum_VDATU],'$(vDate)');


Hope this works for you.

Thanks

Amit

Not applicable
Author

Hi Amit,

thanks for the reply.

Is there a way to look if it doesn't exist after some while criteria?

For example:

status must be '0000'

and organisationnumber must be 1

<pre>
concatenate(TABLE)
Load
0 as OrderIntake,
'$(vDatum)' as Datum
from qvd
where status = '0000'
AND organisation = 1
AND not exists([Vorige datum_VDATU],'$(vDate)');



Rey-man

Not applicable
Author

Hi,

I've got the solution. Maybe it can ben better, but this works.

First I've created the table with the where statements in. Next I used that table to check if a date exists.

With your Concatenate statement it works fine now.

Rgds,

Rey-man