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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

Get Start and End date for each table in the app

Hi.
I have an app with several tables inside of it. 

t1:
Load *
From t1.qvd;

t2:
Load *
From t2.qvd;
...
t22:
Load *
From t222.qvd;

I need to create new table  inside the app that will contain the liast of the all tables name ans timestamps what each of these tables was start loading and finished. I tried to so it via the script below, but I getting only one and the same timestamp for all tables. What am I doing wrong?

t1:
Load *
From t1.qvd;

t2:
Load *
From t2.qvd;
...
t22:
Load *
From t222.qvd;

For t = 0 to NoOfTables() - 1

Tables:
Load
Now() as ReloadStart,
$(t) as id,
TableName($(t)) as Table,
TableNumber(TableName($(t))) + 1 as TableNo,
NoOfRows(TableName($(t))) as TableRows,
Now() as ReloadEnd
Autogenerate 1;

Next t;

1 Solution

Accepted Solutions
JordyWegman
Partner - Master
Partner - Master

Hi Peony,

You can try this:

Timestamps:
Load * Inline [
StartTime, EndTime
];

For each File in FieldValueList('ToBeLoadedQVDs')

  let vStartTime = Now();

  t1:
  Load 
     *
  From $(File).qvd;

  let vEndTime = Now();

  Concatenate(Timestamps)
  Load * Inline [
  StartTime, EndTime
  $(vStartTime),$(vEndTime)
  ];

NEXT
   

Jordy

Climber

Work smarter, not harder

View solution in original post

4 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Peony,

You can try this:

Timestamps:
Load * Inline [
StartTime, EndTime
];

For each File in FieldValueList('ToBeLoadedQVDs')

  let vStartTime = Now();

  t1:
  Load 
     *
  From $(File).qvd;

  let vEndTime = Now();

  Concatenate(Timestamps)
  Load * Inline [
  StartTime, EndTime
  $(vStartTime),$(vEndTime)
  ];

NEXT
   

Jordy

Climber

Work smarter, not harder
Peony
Creator III
Creator III
Author

Hi JordyWegman.

Thank you fir your reply. Unfortunatly, I don't understand from where I should take 'ToBeLoadedQVDs'. Could you please explain?

JordyWegman
Partner - Master
Partner - Master

Of course, that is the list of all your files (QVDs, XLSXs etc.). Below I show you a way how you can create this:

You can choose a way that @jagan created in his post. Fill in your location in the Call ScanFolder('here'); and change the FileExtension to the files you want to check (qvd, xlsx etc.)

Set vConcatenate = ;

FileList:
LOAD
'' AS ToBeLoadedQVDs
AUTOGENERATE 0;

sub ScanFolder(Root)

          for each FileExtension in 'qvw'

                    for each FoundFile in filelist( Root & '\*.' & FileExtension)

                              FileList:
                              LOAD '$(FoundFile)' as ToBeLoadedQVDs
       AUTOGENERATE 1;
                             

                              Set vConcatenate = Concatenate;

                    next FoundFile

          next FileExtension

          for each SubDirectory in dirlist( Root & '\*' )

                    call ScanFolder(SubDirectory)

          next SubDirectory

end sub


Call ScanFolder('C:\Jagan\QV Dashboards\QV Production Dashboards') ;

 Jordy

Climber

Work smarter, not harder
Peony
Creator III
Creator III
Author

Got it! Thank you very very much for help!