Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
markp201
Creator III
Creator III

Using variables for filenames...

I need to create QVD's for either production or test side and looking to use parameterized to variables to simplify the scripts.

For example

Test side - folder1\subfolder1\project\tablename-test.qvd

Prod side - folder2\subfolder2\project\tablename-prod.qvd

LET vEnvironment = 'prod';

LET vFolder = if(vEnvironment='prod','folder2\subfolder2\','folder1\subfolder1');

SET vQVDFilename = $(vFolder) & 'project\' & $1 & '-' & $(vEnvironment) & '.QVD';

//$1 is the tablename

STORE thistable INTO $(vQVDFilename('table')) (qvd);

3 Replies
eespiritu
Creator
Creator

Hi,

Assuming that your QVW file is in the root folder's project, try this:

Let vTestPath = '..\folder1\subfolder1\project';

Let vProdPath = '..\folder2\subfolder2\project';


STORE ThisTable INTO $(vTestPath)\QVDFilename.qvd;

STORE ThisTable INTO $(vProdPath)\QVDFilename.qvd;


Hope this help.


Regads,

markp201
Creator III
Creator III
Author

I need the table in the QVD filename so

\Prod-Table-QVD.qvd

or

\Test-Table-QVD.qvd

I want to have a single set of store commands for test or prod.

eespiritu
Creator
Creator

LET vEnvironment = 'prod';


if '$(vEnvironment)' = 'prod' then

     Let vPath = '..\folder2\subfolder2\project\Prod-';

else

     Let vPath = '..\folder1\subfolder1\project\Test-';

end if


STORE YourTempTable INTO $(vPath)TableName-QVD.qvd;