Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a cycling report, cycling by Field_A. For report naming, I have Dynamic Naming enabled and under Custom Dynamic Naming I have Cycle fields as an Item (which is mandatory). The problem is some values of Field_A are very long strings and the report fails because Windows does not accept such long file names. I tried to create a variable in the Qlik file, but I am unable to use the variable anywhere in dynamic naming and I'm not able to get away from 'Cycle fields' automatically using Field_A.
Thanks for any help.
How about shortening your long field values in script?
for example:
left(field_A,10)&’_’&autonumber(field_A,’field_A’)) as field FieldA2
i this would ensure that you always have unique values and short file names
Hi @sharon_siao
Unless someone else here has found a unique and safe workaround, I would suggest reworking the length of the field name so as to not conflict with windows file name limits.
Most evidence from Microsoft and other site (found in a google search with search phrase "windows file name too long") that shortening the name used is the most robust and safest way to resolve your issue.
Kind regards...
Agree with Frank.
also remember that some characters are not allowed in filenames neither...like / or : , which are often part of a date format or timestamp format
Thank you @Frank_S and @Lech_Miszkiewicz for your helpful suggestions and tips. As Frank mentioned, I did try to "rework" the length of the field by creating a variable Field_A_short = Left(Field_A, 20) in the hopes that I might be able to access and use this variable somewhere in Nprinting where I'm setting dynamic naming. But it didn't present itself for dynamic naming. In addition to this, as mentioned in my original post, it is mandatory to pick Cycle fields as one item (which I understand), but it also forces you to use the field that you cycle on (Field_A for me), so there is no way for me to set this to anything else. As for windows file name restrictions, Lech_M, there is no problem with special characters, the long string is just a string of letters, no special characters. But thanks both of you for taking the time to respond.
Hi @sharon_siao
If the field is not available for cycling, check that:
If either or both of the above, that might be the cause of the issue.
Kind regards...
Sorry, I may not have been clear about where the problem is.
1) This works: Set up report and enable cycling on Field_A. The report runs successfully, cycles through Field_A. If there are 5 values in Field_A, then I get an output of 5 Excel files saved in a Windows folder. So in response to Frank's last post above, I am able to select Field_A to cycle on. And the report works great.
2) This is the problem: For another run of the report, Field_A has let's say 7 values, but 3 of them are very long strings. The report runs fine cycling through values of Field_A. There should be an output of 7 Excel files. The names of these files are created using Field_A concatenated with some other elements (items) that we can customize. Because some values of Field_A are very long, the filename ends up being very long. And this is where the report fails. If I could find a way for the report to not use the Field_A (as is) in the filename, I can circumvent this problem.
In summary, if I did not have long Field_A values, the report would be fine.
Thanks all the same.
How about shortening your long field values in script?
for example:
left(field_A,10)&’_’&autonumber(field_A,’field_A’)) as field FieldA2
i this would ensure that you always have unique values and short file names
And using FieldA2 in your cycle...
Or simply autonumber(fieldA) in script and use it as a cycle field. It will produce number which will not mean anything to you but at least it will produce the rxpected outcome
Yes, Lech_M I think this is the way to go. Although, I have not been able to get my report to work because there are other kinks to work out, meaning I'm not getting my expected results. I need to look to closely at what else I need to take care of in the report in order for it to work. But the cycyling on Field_A2 works. So I will mark this as the solution.
Thanks everyone for your valuable input.