Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

pauldamen
Contributor 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
Contributor II

Re: Script problem QV11 vs QV9

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.

5 Replies
Employee
Employee

Re: Script problem QV11 vs QV9

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
Contributor II

Re: Script problem QV11 vs QV9

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
Contributor II

Re: Script problem QV11 vs QV9

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

Re: Script problem QV11 vs QV9

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

Employee
Employee

Re: Script problem QV11 vs QV9

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

Community Browser