8 Replies Latest reply: Jan 10, 2018 2:33 AM by Jozsef Peitli RSS

    Qualify multiple txt files into one table

    Jozsef Peitli

      Dear All,

       

      I am struggle with data load with qualify statment in QlikSense. Please check my problem and if you know how I should handle please let me know.

       

       

       

      Please...

       

      DataStructure:

      Folder1

      File1.txt

      File2.txt

       

      Folder2

      File1.txt

      File2.txt

       

       

      Script1:


      TableName1:

      LOAD

      Field1,

      Field2,

      Fieldn

      FROM [lib://Folder1/*.txt]

      (txt, codepage is 28591, embedded labels, delimiter is '\t', msq);

       

      TableName2:

      LOAD

      Field1,

      Field2,

      Fieldn

      FROM [lib://Folder2/*.txt]

      (txt, codepage is 28591, embedded labels, delimiter is '\t', msq);

       

      Output1:

      TableName1:

      All the files from both Folder loaded to this table.

      Fields:

      Field1,

      Field2,

      Fieldn

       

      Script2:


      Qualify *;

      Unqualify Field1;


      TableName1:

      LOAD

      Field1,

      Field2,

      Fieldn

      FROM [lib://Folder1/*.txt]

      (txt, codepage is 28591, embedded labels, delimiter is '\t', msq);

       

      TableName2:

      LOAD

      Field1,

      Field2,

      Fieldn

      FROM [lib://Folder2/*.txt]

      (txt, codepage is 28591, embedded labels, delimiter is '\t', msq);

       

      Unqualify*;

       

       

      Output2:

      TableName1:

      The File1.txt from Folder1 loaded to this Table.

      Fields:

      Field1,

      TableName1.Field2,

      TableName1.Fieldn


      TableName1-1:

      The File2.txt from Folder1 loaded to this Table.

      Fields:

      Field1,

      TableName1-1.Field2,

      TableName1-1.Fieldn


      TableName2:

      The File1.txt from Folder2 loaded to this Table.

      Fields:

      Field1,

      TableName2.Field2,

      TableName2.Fieldn


      TableName2-1:

      The File2.txt from Folder2 loaded to this Table.

      Fields:

      Field1,

      TableName2-1.Field2,

      TableName2-1.Fieldn



      WHAT I WANT output:

       

      TableName1:

      All files from Folder1 loaded to this Table.

      Fields:

      Field1,

      TableName1.Field2,

      TableName1.Fieldn

       

       

      TableName2:

      All files from Folder2 loaded to this Table.

      Fields:

      Field1,

      TableName2.Field2,

      TableName2.Fieldn

       

       

      I made 3 images to help understand What will be the ideal output.

       

      Script 1 output using one of the field:

      current.jpg

       

       

      Ideal output:

      wish.jpgwish2.jpg !

       

      Thank you!

       

      Regards

      Jozsef