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

Strange behavior Inline load

Can someone explain this?

LOAD * INLINE
[Name, Value
Name1, "0000"
Name2, "00000000000000"
];

Results in:

inline1.png

And

LOAD * INLINE
[Name, Value
Name1, "0000"
Name2, "0000000000000000"

];

Results in:

inline2.png

Is there a reason for this behavior?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

That's not what I've suggested (using text() function in your load). Why are you using variables here?

But anyway, here your go:

let Value = Text('0000');

TEST:

LOAD Key, Name, text(Value) as Value INLINE

[Key, Name,Value

1, Name1, $(Value)

];

let Value = Text('000000000 ');

LOAD Key, Name, text(Value) as Value INLINE

[Key,Name, Value

2,Name1, $(Value)

];

View solution in original post

11 Replies
Gysbert_Wassenaar

Numbers in qlikview can have only 14 digits. Any string with more digits will be considered text. So in your first example both strings will be evaluated as numbers. But in the second example the second string cannot be interpreted as a number so it ends up as a text value.


talk is cheap, supply exceeds demand
Not applicable
Author

Use the Num function to keep trailing zeros.

Num(Field , '##########0')

Not applicable
Author

Thans for your reply, Gysbert,

If qv interprets the string as a number, why doesn't it display a '0' instead of '0000' in the first example?

I need the input to be strings, so I tried:

let Value = Text('0000');
TEST:
LOAD * INLINE
[Key, Name,Value
1, Name1, $(Value)
]
;

let Value = Text('000000000 ');
LOAD * INLINE
[Key,Name, Value
2,Name1, $(Value)
]
;

Same result however:

inline3.png

Not applicable
Author

Thanks for your reply dathu.qv,

Could you give an example? I wasn't able to load the values in the first example using this function.

swuehl
MVP
MVP

Because QV also tries to keep the format as seen for the first occurrence. Add another line Name0, 0  as first line to the first inline loaf of your initial post to see what I mean. Use the num() function to explicitely define the text representation of your value (and if you don't already know, search for dual value to read more about this).

Not applicable
Author

Thank you swuehl,

Ok, I understand what you mean.

In my case, the values I want to load are strings. So '0000' and  '000000' aren't the same and aren't numbers.

(codes for categories in my case, as '0' or '00' could be). The dual function would be helpful, but then I would have to define all categories in advance, and I don't know how many and which to expect.

I'm looking for a way to force qv to load the values as strings.

swuehl
MVP
MVP

Use the text() function

LOAD Name, text(Value) as Value INLINE
[Name, Value
Name1, "0000"
Name2, "00000000000000"
];

Not applicable
Author

Hi swuehl,

I already tried that, with no success:

let Value = Text('0000');
TEST:
LOAD * INLINE
[Key, Name,Value
1, Name1, $(Value)
]
;

let Value = Text('000000000 ');
LOAD * INLINE
[Key,Name, Value
2,Name1, $(Value)
]
;

Same result however:

inline3.png

swuehl
MVP
MVP

That's not what I've suggested (using text() function in your load). Why are you using variables here?

But anyway, here your go:

let Value = Text('0000');

TEST:

LOAD Key, Name, text(Value) as Value INLINE

[Key, Name,Value

1, Name1, $(Value)

];

let Value = Text('000000000 ');

LOAD Key, Name, text(Value) as Value INLINE

[Key,Name, Value

2,Name1, $(Value)

];