Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load script with multiple columns

Hi Dear Commutity,

Thank you for check on my post ,

I am a newer on QlickView,

and I had a problem in this case,Could you like to give some suggestions?

LOAD
A,
B,
A & ‘:’ & B as C

INLINE [
  A,B
  101, 121
  103, 001
]

The result is
A B C
101 121 101:121
103 001 101:121 There should be (103:001) as I thought

The result of 103 is wrong,but when I change ‘:’ to other symbol like ‘_’ the result is right,

I want to find some suggestions for why this might occur I would suggest.

Thank you again for any suggestions!

Labels (2)
12 Replies
Anonymous
Not applicable
Author

It is right you must get the answer

other wise you try this one

Table:

LOAD A,

  B,

  A & ':' & B as C

INLINE [

  A,B

  101, 121

  103, 001

]

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The probable cause of this code working for some and not working for others, is that the colon-character may be used to implicitly interprete values as something else (like a time value).

QlikView contains a lot of internal conversion code that tries to recognize and convert values from one format into another. All behind the scenes and purely for performance reasons (QlikView really is quick!) Classical cases are time and date values that suddenly display other string representations because the underlying numerical value is identical and in a symbol table every single numerical value can only have one string representation.

In your case,  after string concatenation 101:121 is treated as a time (hh:mm) value. In minutes (this is not the internal representation but the logic is the same) this comes down to a value of 101*60 + 121 = 6181.

The other string 103:101 is also treated as a time value and converted to 103*60 + 001 = 6181. However, because this value already exists in the field symbol table, it will not get a new string representation. The first one will survive.

You should get the exact same result with values 102 and 061.

Solution: do not create strings or key fields that may look to QlikView like timestamps, dates, or numerical values, as QlikView will most certainly try to convert them to a numerical value behind your back. Add a character in front, or change the colon into something else (like a vertical bar | ). Never use colons or dots in the construction of key values as you will most certainly be in serious trouble.

Peter

Not applicable
Author

Hi Peter

Thank you for your reply,It's very helpful,

It was a bad idea to use a colon in the construction of key values,

I will never do it again in my code,

Yumi