Had an ask to create a dashboard that would show the start and end times for all dashboards and call out errors.
Our dashboards are in multiple nested file paths so this loops through multiple directories and/or servers to produce 1 report.
Sorry I had to scramble paths, server names and dashboard names.
You only need to change the call scan folder to match your paths.
Set vConcatenate = ;
for each FileExtension in 'log'
for each FoundFile in filelist( Root & '\*.' & FileExtension)
LOAD *, '$(FoundFile)' as SourceFile, if(Index(@1,'Execution Failed')>0,'FAILED') as JobStatus,
trim(right(@1,len(@1)-index(@1,':',-1)-1)) as errorLine,
left(subfield('$(FoundFile)','\',-1),len((subfield('$(FoundFile)','\',-1)))-4) as Dashboard,
left(@1,index(@1,':',-1)-1) as ActionTime
FROM [$(FoundFile)] (txt, unicode, no labels, delimiter is '\n', msq);
Set vConcatenate = Concatenate;
for each SubDirectory in dirlist( Root & '\*' )
Call ScanFolder('\\xxxxx\QlikviewFiles\SourceDocuments\MAIN\09_App') ;
//Substitute your full paths can handle as many folder paths as you like.
Call ScanFolder('\\xxxx2\QlikviewFiles\SourceDocuments2\Other Dashboards') ;
left(SourceFile,len(SourceFile)- (len(Dashboard)+4)) as Path resident MAIN
where wildmatch(errorLine,'*Execution finished*','*Execution started*','*Execution failed*')>0;
Load * inline [errorLine,Line Status
Execution started., 1-STARTED
Execution Failed, 3-FAILED];
drop table MAIN;
load Dashboard, 1 as FailureFlag