Conditional SQL import allows you to set option to run the import only in cases when the data in database have changed. To allow this feature go to selected data source, open Conditional settings dialogue window and select option Conditional import enabled.

When this option is selected, scheduled import will run only if the data in the database have changed.

Click on button SQL query to open dialogue window where should be added SQL query which will check if the data have been changed. If the query returns data import will run.

Since version 2.9.1, it is possible to use SQL variables (lastValue, firstValue etc.) in conditional import.

An example of the SQL query which will check whether the data in the source database have changed:

SELECT 
CASE WHEN max(ID) > '$lastValue(M_ID)' THEN '1' ELSE '0' END
FROM db1.orders

In this case, max(ID) will return the highest value from column ID in the database orders.

$lastValue(M_ID) will return the highest value of the indicator with code M_ID in the related data set.

 

Click on button Create to setup import settings of conditional import: