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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
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)
1 Reply
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.