Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jessica_webb
Creator III
Creator III

Reloading data as cross table - script failure

Hi,

I'm getting the 'Execution of script failed' message (but no explanation why).

It's happened since I added in a section to reload the same datasource, but as a cross table.

Is anyone able to see where I'm going wrong? I don't think I have any loops in there...

TABLE_DATA:

LOAD

     '$(vProgress1)' as Progress_point,

     ID,

     ApplyMap('Long_map',Type) as Type_long,

     Set as Initial_Set,

     Current,

    Expected

    FROM

[..\Data received\$(vProgress1)\$(vFilename1).xlsx]

(ooxml, embedded labels, table is [Data template]);

temp1:

CrossTable(Cat, Outcome, 10)

LOAD

'$(vProgress1)' as Progress_point,

     ID,

     ApplyMap('Long_map',Type) as Type_long,

     Set as Initial_Set,

     Current,

     Expected

FROM

[..\Data received\$(vProgress1)\$(vFilename1).xlsx]

(ooxml, embedded labels, table is [Data template]);

LEFT JOIN (TABLE_DATA) LOAD *

Resident temp1;

Drop TABLE temp1;

LEFT JOIN (TABLE_DATA) LOAD *

Resident temp1;

Drop TABLE temp1;

LE temp1;LE

It it helps, what I wanted from the original 'TABLE_DATA' is to keep 'Current' and 'Expected' as they are. But then also add two new fields, one called 'Outcome' which would hold the values of Current and Expected, and and another called 'Cat' which would tell me whether the Outcome was from the Current or Expected field.

1 Solution

Accepted Solutions
jmvilaplanap
Specialist
Specialist

Another thing I saw is that in the cross table you have a 10 in the config (first line) and you only have 6 fields.

View solution in original post

12 Replies
vishsaggi
Champion III
Champion III

What happens if you just run these two? Picked from the script above. Include your Mapping load too.

TABLE_DATA:

LOAD '$(vProgress1)' as Progress_point,     

     ID,     

     ApplyMap('Long_map',Type) as Type_long,

     Set as Initial_Set,

     Current,    

     Expected    

FROM [..\Data received\$(vProgress1)\$(vFilename1).xlsx] (ooxml, embedded labels, table is [Data template]);

temp1:

CrossTable(Cat, Outcome, 10)

LOAD '$(vProgress1)' as Progress_point,

      ID,     

      ApplyMap('Long_map',Type) as Type_long,     

      Set as Initial_Set,     

      Current,     

      Expected

FROM [..\Data received\$(vProgress1)\$(vFilename1).xlsx] (ooxml, embedded labels, table is [Data template]);

jessica_webb
Creator III
Creator III
Author

I'm getting the 'Execution of script failed' message (but no explanation why).

jmvilaplanap
Specialist
Specialist

Maybe you are using a reseved word "SET" in the data fields.

jmvilaplanap
Specialist
Specialist

Another thing I saw is that in the cross table you have a 10 in the config (first line) and you only have 6 fields.

jessica_webb
Creator III
Creator III
Author

The original file itself has 10 fields, so that wouldn't be an issue. And the word 'Set' in a data field also shouldn't matter...

But thanks for the suggestions

jmvilaplanap
Specialist
Specialist

Maybe the file is used by another program, I had problems with this, but trying to save a QVD

sunny_talwar

So you are loading the same data set twice one where you crosstable and one where you don't? what's the use?

jessica_webb
Creator III
Creator III
Author

Nope, not being used anywhere else!

jessica_webb
Creator III
Creator III
Author

Hi Sunny,

Yes, same data set being loaded twice.

The reason is, what I wanted from the original 'TABLE_DATA' is to keep 'Current' and 'Expected' as they are (i.e. two distinct fields).

But then I also want to add two new fields, one called 'Outcome' which would hold the values of Current and Expected, and and another called 'Cat' which would tell me whether the Outcome was from the Current or Expected field.