Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Writing a loop in my load script

Dear Qlikviewers,

I have attached a script that works fine. The first part determines the most recent date for which all reports are available and then I use a LET statement to determine which report should be loaded in the later parts. The second part loads all trade positions, which have 2 lines per position, this part transforms the data so that each position has 1 line. In the 3rd part, I load all the reports that I need and join them togethether to make one large table.

This script finally results in a table that has all the information that I need from all the seperate accounts together.

Now here is the trouble. This table has the most recent data available, but it does not include data from earlier reports. I want to use historic data in my dashboard so I can see from our reports how things have developed over time, create benchmarks etc.

I have tried to write a loop for this script using all sorts of information from different topics within the Qlikview community website. However, I have yet to find a solution. I must say I am really new to scripting.

I was thinking that the easiest way to go would be to take the minimum date and then let a loop add one day to the date every time and I each time add the timestamp to the table so I can distinguish between dates.

If the file is not available, it should skip to the next date. But it should also skip the day if not ALL files are available for that date. How would I go about writing such a script? I have tried some loops, but none has proven to be successful so far.

My filenames all end with the date 'DDMMYYYY', the reports are all in csv format, but the positions are in an excel table (xls).

Community Browser