Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
All,
I have a line off script which works perfectly fine when developed in QV version 11. When I transfer it to the server environment which is QV version 9 and reload the script the line [Project ID] stays empty (other 2 fields work as normal).
Could you guys help me why this line stays empty? Is there something with this Upper or Mid function in QV version 9?
Regards,
Paul
for
each File in filelist ('\\proqviewhq-01\OnePM\*.pdf')
Load '$(File)' as Name,
FileTime( '$(File)' ) as FileTime,
Upper(Mid('$(File)' ,69, 9)) as [Project ID]
autogenerate 1;
NEXT File
Your answer got me thinking and I found the solution:
The mid function is starting at character 69, but the file path changed on the server and is much shorter, so it should start at 25. It is empty because character 69 does not excists.
No, there is no difference between QlikView 9 and QlikView 11 here.
I would rather suspect that your file paths change and this affect the result from the Mid-function.
HIC
Dear Henric,
Thank you for the reply.
The strange thing is that the other 2 fields are working correctly so if the location would be the problem I would expect the other 2 fields to be empty as well.
Any ideas why only this field would be empty?
Regards,
Paul
Your answer got me thinking and I found the solution:
The mid function is starting at character 69, but the file path changed on the server and is much shorter, so it should start at 25. It is empty because character 69 does not excists.
First 2 field calculation based file attribute..
3rd is purely based on file name. So please check file name exactly. It should contain atlease 69 letters..
Karthik
If the other fields are returning values, then it means that the script indeed has found the files.
But the Mid(x, 69, 9) could still be wrong - the "69" and "9" are hard-coded numbers that perhaps should be something else in the server environment. I wouldn't hard-code these.
I would instead use the Index() function to calculate these numbers. For example, if you want the string from the second-to-last backslash, you can calculate the position if this by using Index(x,'\',-2).
HIC