Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
In a Qlikview script I have found an issue that drives me crazy until I found the mistake.
I put a sample script to show the issue.
table:
LOAD * INLINE [
Key_Field_With_A_Long_Name, Field2
1, A
2, B
4, D
5, E
];
Concatenate
LOAD * INLINE [
Key_Field_With_A_Long_Name, Field3
1, AA
2, AA
3, AA
4, AA
5, AA
] where not Exists ('Key_Field_With_A_Long_name', Key_Field_With_A_Long_Name);
After that, the resulting table expected is
Key_Field_With_A_Long_Name | Field2 | Field3 |
---|---|---|
1 | A | - |
2 | B | - |
3 | - | AA |
4 | D | - |
5 | E | - |
But the real table is
Key_Field_With_A_Long_Name | Field2 | Field3 |
---|---|---|
1 | A | - |
2 | B | - |
4 | D | - |
5 | E | - |
The problem is in the exists expression.
The developer writes Key_Field_With_A_Long_name instead Key_Field_With_A_Long_Name. Notice the upcase/lowcase.
In this case Qlikview runs the script without report errors, but the second load does not append any row to the table. The new Field3 is created in the table.
Is this the expected functionality or it would be more correct that Qlikview reports an error?
Thanks in advance
Hi,
Qlikview is case sensitive tool.
Please find the attachment.
Regards,
P.Prasath
Hi,
Your script should be
table:
LOAD * INLINE [
Key_Field_With_A_Long_Name, Field2
1, A
2, B
4, D
5, E
];
Concatenate
LOAD * INLINE [
Key_Field_With_A_Long_Name, Field3
1, AA
2, AA
3, AA
4, AA
5, AA
] where not Exists (Key_Field_With_A_Long_Name);
Hi
Try this Script
table:
LOAD * INLINE [
Key_Field_With_A_Long_Name, Field2
1, A
2, B
4, D
5, E
];
Concatenate
LOAD * INLINE [
Key_Field_With_A_Long_Name, Field3
1, AA
2, AA
3, AA
4, AA
5, AA
] where not Exists ( Key_Field_With_A_Long_Name)
and Exists ( Key_Field_With_A_Long_Name);
Hi
First, you should not use ' around the field names in Exists (use [ ] if needed).
Second, when the fields you want to check has the same name, you only need to write it one time:
where not Exists(Key_Field_With_A_Long_Name);
Third, use copy and paste when dealing with long field or table names , that helps a lot.
/gg
Thanks to all by your answers. But my main interest is if there is any reason for Qlikview don´t report an error in this case?
Qlikview help says that field will have to appear in the data loaded until then by script.
Yes I agree, it is not meaningful to use a "field name" which does not exist, this is more likely to happen beacuse of a typo.
This ought to generate a script error in my opinion since the Help says that the field must exists.
I suggest you report it as a bug.
/gg