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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Necator
Contributor III
Contributor III

Query Tag - Session Timeout

Hello, we usually use a query tag to set context for our queries to our warehouse. It looks as follows:

LIB CONNECT TO 'Admin:Snowflake'; Let vAppName = DocumentTitle(); SQL alter session set query_tag='$(vAppName)' !EXECUTE_NON_SELECT_QUERY;

In the past we set this once at the beginning of the script. In Qlik Cloud, though, this doesn't seem to persist for the whole duration of the reload, so the information gets lost for some SQL loads later in the script. Is there a possibility to set this via the Snowflake connection as an advanced parameter, to get rid of this code snippet entirely?

Labels (2)
2 Replies
Chanty4u
MVP
MVP

Hi

Yes, if you're using Snowflake, the best practice is to set QUERY_TAG in the connection/session configuration rather than relying on ALTER SESSION once at the start of the script.

 

Check the Snowflake connection's Advanced Properties first. If QUERY_TAG isn't supported there, assume Qlik Cloud may create new sessions during reloads and set the tag again where needed.

Necator
Contributor III
Contributor III
Author

Hey,

I dont think AppName() is supported within the connection as Value for Query Tag parameter.