Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Table loop

Hi,

I'd tried to import a list of txt-files. The numbers of documents is variable. After I execute this script, qlikview generate a lot of tables called "qlik_details", "qlik_details-1", "qlik_details-2" and so on. The problem is, that we need all the data in one table called "qlik_details".

I tried to handle this with "resident", but it does not work.

Any ideas?

Many thanks,

Hernandez

Sub DoDir (Root)

          For Each Ext In 'txt'

                    For Each vFile In FileList (Root & '\*CPG_CLICK_DETAIL*.' & Ext)

                              qlik_details:

                              QUALIFY*;

                              Load

                              CAMPAGNE_ID,

                               MEMBER_ID,

                         CLIENT_ID,

      SEGMENT,

                         SOURCE, 

                         UPLOAD_ID

                              FROM $(vFile)

                              (txt, utf8,embedded labels,delimiter is ';', msq);

                    Next vFile

          Next Ext

          For Each Dir In DirList (Root & '\*') // Subfolders

                    Call DoDir (Dir)

          Next Dir

End Sub

Call DoDir ('D:\Files\ClientFolder'); // Folder

UNQUALIFY*;

Tags (3)
1 Solution

Accepted Solutions
forte
New Contributor III

Table loop

Hi Hernandez ,

You can't use qualifying in this context. You are changing the field's names on each loop, so Qlikview is not able to make the implicit concatenate (as you it's only done when both tables have the same number of fields and the same names for them).

Try to avoid qualify (and unqualify) sentence and it will work.

Hope it helps

Regards

2 Replies
forte
New Contributor III

Table loop

Hi Hernandez ,

You can't use qualifying in this context. You are changing the field's names on each loop, so Qlikview is not able to make the implicit concatenate (as you it's only done when both tables have the same number of fields and the same names for them).

Try to avoid qualify (and unqualify) sentence and it will work.

Hope it helps

Regards

Not applicable

Table loop

It works!


Thanks!

Community Browser