Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Script problem QV11 vs QV9

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

1 Solution

Accepted Solutions
pauldamen
Partner - Creator II
Partner - Creator II
Author

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.

View solution in original post

5 Replies
hic
Former Employee
Former Employee

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

pauldamen
Partner - Creator II
Partner - Creator II
Author

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

pauldamen
Partner - Creator II
Partner - Creator II
Author

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.

Not applicable

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

hic
Former Employee
Former Employee

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