Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Here is my problem:
I have a text file with these two lines :
"007";"HEAD OFFICE/DIVISION FORMS"
"7";"PLUMBING"
When I load that file using that script :
LOAD @1 as ProductClassCode,
len(@1) as length,
@2 as ProductClassDesc
FROM
Here is what I see :
ProductClassCode,ProductClassDesc,length
007,HEAD OFFICE/DIVISION FORMS,3
007,PLUMBING,1
Any idea on how to load 1 character when the length is one and three when it is three ?
Thanks for your help.
Philippe
Hi
QV interprets the field as a number and since the numeric representation of the field is the same it is displayed in the same way.
Try this to solve your problem:
text
(@1) as ProductClassCode
/Fredrik
It seems Qlikview does the casting automatically and goes wrong.
You should find a way to make sure the cast of the ProductClassCode is string ... now it seems the first line read is interpreted like a numeric 3 long with zero's at the front. Instead of this it needs to be string.
You could try casting it during the load with a string function ... e.g. trim(ProductClassCode) as ProductClassCode
Don't know if this is the best way, but seems to be a quick solution.
I tried it but it does not solve the issue
Philippe
Hi
QV interprets the field as a number and since the numeric representation of the field is the same it is displayed in the same way.
Try this to solve your problem:
text
(@1) as ProductClassCode
/Fredrik
Thanks a lot ...
That works.
Philippe