Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exists function issue or expected functionality.

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_NameField2Field3
1A-
2B-
3-AA
4D-
5E-

But the real table is

Key_Field_With_A_Long_NameField2Field3
1A-
2B-
4D-
5E-

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

6 Replies
Not applicable
Author

Hi,

Qlikview is case sensitive tool.

Please find the attachment.

Regards,

P.Prasath

CELAMBARASAN
Partner - Champion
Partner - Champion

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);

perumal_41
Partner - Specialist II
Partner - Specialist II

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);

gandalfgray
Specialist II
Specialist II

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

Not applicable
Author

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.

gandalfgray
Specialist II
Specialist II

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