Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Nicole-Smith

How to determine what started a dashboard reload?

Our team has built a process that reloads our dashboards only after certain criteria are met.  This is done using EDX triggers in the QMC.  However, sometimes other teams bypass our process, and reload our dashboards by logging into the QMC and hitting start.  I need a way to determine in the load script how the reload job was started--I really only need to know whether it was EDX or not.  Does anyone have any idea how/where to get this information?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There is no script function I know of to tell how you were triggered.  If you can access the TaskLog.txt in the distribution logs folder for the running task, the first line of the log does indeed tell what kind of trigger did kick off this task.

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

5 Replies
sunny_talwar

This is very interesting, I have no idea how you would do this, but would love to learn about this. May be @rwunderlich might be able to guide us.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There is no script function I know of to tell how you were triggered.  If you can access the TaskLog.txt in the distribution logs folder for the running task, the first line of the log does indeed tell what kind of trigger did kick off this task.

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Nicole-Smith
Author

This is exactly what I needed, thanks @rwunderlich!

Nicole-Smith
Author

For anyone else that comes across this thread, this is how I solved for this:

/* Directories to look for the logs in - these logs are split into different folders by day and dashboard */
LET vRootDirDate = DATE(TODAY(), 'YYYYMMDD');
LET vRootDir = CHR(39) & 'C:\ProgramData\QlikTech\DistributionService\1\Log\' & $(vRootDirDate) & '\*' & CHR(39);
SET vRootDirDate =;

/* Looping through the directory to get a list of each folder */
FOR EACH d IN DirList($(vRootDir));
	FolderList:
	LOAD '$(d)' AS [Folder]
	AUTOGENERATE 1;
NEXT d
SET vRootDir =;
SET d =;

/* Getting the latest folder for the current dashboard */
LastLoad:
LOAD MAXSTRING([Folder]) AS [LatestFolder]
RESIDENT FolderList
WHERE [Folder] LIKE '*' & SUBFIELD(DOCUMENTNAME(), '.', 1) & '*';
DROP TABLE FolderList;

LET vTaskLog = PEEK('LatestFolder', 0, 'LastLoad') & '\TaskLog.txt';
DROP TABLE LastLoad;

/* Determining how the dashboard load was started */
TaskLog:
LOAD @3 AS [TaskDetail]
FROM $(vTaskLog) (txt, utf8, no labels, delimiter is '\t', msq)
WHERE @3 LIKE '*Triggered By*';
SET vTaskLog =;

LET vTriggeredBy = SUBFIELD(SUBFIELD(PEEK('TaskDetail', 0, 'TaskLog'), 'Triggered by ''', 2), CHR(39), 1);
DROP TABLE TaskLog;

I end up using the vTriggeredBy variable to determine what started the load and have subsequent actions based on that value.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Really nice bit of code Nicole. Thanks for sharing. 

-Rob