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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Thomas23
Contributor III
Contributor III

How can I compare two dates in a Qlik REST API URL RestConnectorMasterTable call?

Hi,
I'm iterating through all apps in Qlik Cloud using the REST API and reading all reloads.

The WITH CONNECTION section looks like this:
WITH CONNECTION (
URL "https://$(myTenant)/api/v1/tasks/resources/043d080d-3d50-4549-8d24-f3d5f32c9259/runs?limit=100"
);

However, I only want results that are greater than "today()-1" or greater than a specific date.

I've already tried "limit=100&endedAt>2026-05-15T00:00:00.000Z" with and without quotation marks, also single quotes. I get the error message "Invalid Query Parameter".

I also tried using QUERY, but it doesn't work:
?limit=100,QUERY "endedAt" ">2026-05-15T00:00:00.000Z"

There's no error message, but I get all the reloads—it isn't limited to a specific date.

Do you have any idea how I can filter by a specific date?

Best regards,
Thomas

Labels (2)
1 Solution

Accepted Solutions
stijnvaneven
Partner Ambassador
Partner Ambassador

Hi Thomas,

For this endpoint I don’t think you can filter by endedAt directly in the URL.

The endpoint:

/api/v1/tasks/resources/{id}/runs

only documents these query parameters: limit,page,sort

endedAt is part of the response body, but it is not listed as a supported query/filter parameter. That is why a URL like this returns “Invalid Query Parameter”:

?limit=100&endedAt>2026-05-15T00:00:00.000Z

The closest you can do server-side is sort the results, for example:

WITH CONNECTION (

  URL "https://$(myTenant)/api/v1/tasks/resources/043d080d-3d50-4549-8d24-f3d5f32c9259/runs?limit=100&sort=-endedAt"

);

Then filter the records in the Qlik load script after the REST call, for example:

LET vFromDate = Timestamp(Today() - 1, 'YYYY-MM-DDThh:mm:ss.fffZ');

 

Runs_Filtered:

LOAD *

RESIDENT RestConnectorMasterTable

WHERE Timestamp#(endedAt, 'YYYY-MM-DDThh:mm:ss.fffZ') >= Timestamp#('$(vFromDate)', 'YYYY-MM-DDThh:mm:ss.fffZ');

If you have more than 100 runs, use the page / next link pagination and stop loading once the sorted endedAt values are older than your threshold.

View solution in original post

2 Replies
stijnvaneven
Partner Ambassador
Partner Ambassador

Hi Thomas,

For this endpoint I don’t think you can filter by endedAt directly in the URL.

The endpoint:

/api/v1/tasks/resources/{id}/runs

only documents these query parameters: limit,page,sort

endedAt is part of the response body, but it is not listed as a supported query/filter parameter. That is why a URL like this returns “Invalid Query Parameter”:

?limit=100&endedAt>2026-05-15T00:00:00.000Z

The closest you can do server-side is sort the results, for example:

WITH CONNECTION (

  URL "https://$(myTenant)/api/v1/tasks/resources/043d080d-3d50-4549-8d24-f3d5f32c9259/runs?limit=100&sort=-endedAt"

);

Then filter the records in the Qlik load script after the REST call, for example:

LET vFromDate = Timestamp(Today() - 1, 'YYYY-MM-DDThh:mm:ss.fffZ');

 

Runs_Filtered:

LOAD *

RESIDENT RestConnectorMasterTable

WHERE Timestamp#(endedAt, 'YYYY-MM-DDThh:mm:ss.fffZ') >= Timestamp#('$(vFromDate)', 'YYYY-MM-DDThh:mm:ss.fffZ');

If you have more than 100 runs, use the page / next link pagination and stop loading once the sorted endedAt values are older than your threshold.

Thomas23
Contributor III
Contributor III
Author

Hello Stijnvaneven,

thank you for your support.
I solved the problem with sorting and the where clause.

Best regards 
Thomas