Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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?

Tags (3)
1 Solution

Accepted Solutions
swuehl
Not applicable

Re: Strange behavior Inline load

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)

];

11 Replies
Gysbert_Wassenaar
Not applicable

Re: Strange behavior Inline load

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

Re: Strange behavior Inline load

Use the Num function to keep trailing zeros.

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

Not applicable

Re: Strange behavior Inline load

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

Re: Strange behavior Inline load

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
Not applicable

Re: Strange behavior Inline load

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

Re: Strange behavior Inline load

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
Not applicable

Re: Strange behavior Inline load

Use the text() function

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

Not applicable

Re: Strange behavior Inline load

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
Not applicable

Re: Strange behavior Inline load

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)

];