Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Writing a set analysis issue

I only want to count the test_id's when the interventiondate is later in time then the datetime.

The expression below I used doesn't work:

count(distinct {<interventiondate={">datetime"} >} test_id)

How do I write this?

Kind regards,

Katleen

11 Replies
Not applicable
Author

Works in the example file, but when I insert it into my original script I get the error that the field 'interventiondate' can't be found.

Acties_totaal:

load *,

  if(interventiondate>=process_datetime,1,0) as IntDateBiggerThanDateTimeFlag;

LOAD _id                          as test_id,

     _address_id                as addresses_id,

     action_category,

     actionname,

     status                          as acties_totaal_status,

     interventiondate               as acties_totaal_interventiondate,

     process_datetime           as acties_totaal_datetime

FROM

[..\2. Extraction to QVD layer\QVD_Ettenleur\Actions_69.qvd]

(qvd);

Can you see what is wrong with my script?

simenkg
Specialist
Specialist

Yes. This is because we are essentially doing TWO loads. The top one is a load FROM the bottom one. So since you change the name of the field interventiondate, it no longer exists in the top load.

change to:

load *,

  if(acties_totaal_interventiondate>=acties_totaal_datetime,1,0) as IntDateBiggerThanDateTimeFlag;

LOAD _id                          as test_id,

     _address_id                as addresses_id,

     action_category,

     actionname,

     status                          as acties_totaal_status,

     interventiondate               as acties_totaal_interventiondate,

     process_datetime           as acties_totaal_datetime

FROM

[..\2. Extraction to QVD layer\QVD_Ettenleur\Actions_69.qvd]

(qvd);