Discussion board where members can get started with QlikView.
This seems like it should be very straightforward, but... I still can't get it to work for me.
Basically, I have many data sources in my qvw, all with the same 'name' in different places. I also have to reload the data regularly and change the 'name'.
In the past, I have done a search replace, but I was hoping I could speed this up by using a variable.
So for example, my file path might be:
If I wanted to change 'Apple' to 'Orange', how would I do that?
So far I've got:
Set vName = Orange
And have changed the file path to:
But when I run this I get:
Which obviously isn't recognised. How do I get the script to recognise the 'map.qvd' part of the file path?
when I enter this script in a new qvw
Set vName = Orange; Load * FROM [..\..\SourceData\QV_Data\QVDs\$(vName)map.qvd] (qvd);
and debug the script, I see correct value
try like this:
Set vName = 'Orange';
[..\..\SourceData\QV_Data\QVDs\$(vName) map.qvd] (qvd);
For me, it works like that way!
Hope this helps
I have similar things in my script and they do work, so you are definitely on the right track.
I would try
[..\..\SourceData\QV_Data\QVDs\$(vName) maps.qvd] (qvd); and
[..\..\SourceData\QV_Data\QVDs\england_spine $(vName).qvd] (qvd); (the path you give is not similar)
Or try when they are renamed like
[..\..\SourceData\QV_Data\QVDs\$(vName)_maps.qvd] (qvd); and
[..\..\SourceData\QV_Data\QVDs\england_spine_$(vName).qvd] (qvd); (so lose the blanks in the file name)
Thank you all for your responses - it seems that it's something to do with me keeping 'Directory;' before my LOAD script.
I've always left it in as default (unless I'm joining tables), but I guess perhaps I shouldn't be!
Time to do some reading on the Directory function...