Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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)
1 Solution

Accepted Solutions
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

View solution in original post

12 Replies
sunny_talwar

I see the right result:

Capture.PNG

Script:

Table:

LOAD A,

  B,

  A & ':' & B as C

INLINE [

  A,B

  101, 121

  103, 001

]

Not applicable
Author

Hi

I got right result.

Thank you.

Chanty4u
MVP
MVP

the code is correct it is showng exctly.

try to chk ur code once  and reload again.

Not applicable
Author

Hi Sunny

Thank you for your code,

It's weird , I tried your qwd on my computer ,

But It isn't work for me.

The result is still ><

   

ABC
101121101:121
103001101:121
Chanty4u
MVP
MVP

COOOOOOOL

please close this thread by making correct and helpful answers.

Qlik Community Tip: Marking Replies as Correct or Helpful

Not applicable
Author

I was also getting the same result like you . But finally sort it  out either by  converting resultant field C to

number or text.

See  the attached .

sunny_talwar

What version of QV are you using? May be an old bug?

Not applicable
Author

Hi Sunny,

As you said it might be a bug. I am using 11.0 SR1 version QV.

Not applicable
Author

Qlikview see this data as timestamp formatting.

So 101:121 is equal to 103:001. 121 means 2*60 + 1