Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sfbi
Creator
Creator

Alert when new record is loaded

Hi,

I'm trying to create an Alert (Qlik Alerting SaaS) when a new record is loaded. Any idea on how to create a measure to compare it.

The alert must be trigger when a new IDORDER is loaded on the app.

Labels (5)
1 Solution

Accepted Solutions
sfbi
Creator
Creator
Author

ok... I managed it on script.

1.

 

Let ThisExecTime = Timestamp(ConvertToLocalTime(Now(),'Brasilia',true),'YYYY-MM-DD hh:mm:ss');

[LASTLOAD]: //new table to store the last values.
Load
max(IDCAMPOCHECK) AS LASTIDCAMPOCHECK, //max to get the last loaded ID.
'$(ThisExecTime)' AS LASTTIME, //last load time for control only, not necessary for create the alert. 
if(max(IDCAMPOCHECK) = '$(LastIDCampoCheck)', 0, 1) AS FLNEW //compare the current loaded max ID, with the last value stored on the variable bellow. flag 0 is not new and 1 if new.
Resident [CAMPOCHECK];

//create the variable to store the last id loaded.
Let LastIDCampoCheck = Peek('LASTIDCAMPOCHECK',0,'LASTLOAD');

 


2. then create a new measure name NEW ID = sum(FLNEW);

3. create an alert using the NEW ID measure, and if its greater than 0, the alert is triggered. 

View solution in original post

6 Replies
Anil_Babu_Samineni

Please create one measure like

If(RowNo(TOTAL)>Count(FieldName), 1,0)

Then created on alert based on this measure and see if that works?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sfbi
Creator
Creator
Author

Hi... I got your idea, but it didn't worked as expected. I expect that only new records after reloading count for the alert.

The ID 89 was the last one loaded, and it is new in the firsts reload. But after reloading the app one more time, it is still considering this as a new record (count new is your suggested formula), and it should not. 

sfbi_1-1605637539440.png

Let me you if I missed something. Thank you!

Anil_Babu_Samineni

How complex model you have?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sfbi
Creator
Creator
Author

If you meant data model... I can't print it it here from de data model, but there is:

5 fact tables linked and 7 dimension tables... not complex in my perspective and few records for now.

sfbi
Creator
Creator
Author

ok... I managed it on script.

1.

 

Let ThisExecTime = Timestamp(ConvertToLocalTime(Now(),'Brasilia',true),'YYYY-MM-DD hh:mm:ss');

[LASTLOAD]: //new table to store the last values.
Load
max(IDCAMPOCHECK) AS LASTIDCAMPOCHECK, //max to get the last loaded ID.
'$(ThisExecTime)' AS LASTTIME, //last load time for control only, not necessary for create the alert. 
if(max(IDCAMPOCHECK) = '$(LastIDCampoCheck)', 0, 1) AS FLNEW //compare the current loaded max ID, with the last value stored on the variable bellow. flag 0 is not new and 1 if new.
Resident [CAMPOCHECK];

//create the variable to store the last id loaded.
Let LastIDCampoCheck = Peek('LASTIDCAMPOCHECK',0,'LASTLOAD');

 


2. then create a new measure name NEW ID = sum(FLNEW);

3. create an alert using the NEW ID measure, and if its greater than 0, the alert is triggered. 

luizcdepaula
Creator III
Creator III

This worked perfectly for my situation. Thank you!