Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
svsudhakar
Creator
Creator

Variables


Hi ,

Is any possible to copy the variables from one application to another application ?

Ex:

I have created more than 100 variables in my application. I have to copy all variables from one app to  another application. Please suggest on this.

Regards,

Sudhakar

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Unfortunately it is not possible,

the solution is to create variables in the script with LET and SET instructions.

Not applicable

You can use an include script instead of creating it in qvw file.

Shameem.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You can extract the variables using a script like this:

Let zFileName = 'C:\Projects\Project1\Model.qvw';

VariableDefinition:

LOAD

  Name   As Variable.Name,

  RawValue   As Variable.Definition

FROM [$(zFileName)] (XmlSimple, Table is [DocumentSummary/VariableDescription])

Where Not(IsReserved = 'true' Or IsConfig = 'true');

For i = 0 to NoOfRows('VariableDefinition') - 1

  Let zVarName = Peek('Variable.Name', i, 'VariableDefinition');

  Let zVarValue = Peek('Variable.Definition', i, 'VariableDefinition');

  Let $(zVarName) = zVarValue;

Next

Set the value of zFileName to the model from which you would like to get the variables.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
maleksafa
Specialist
Specialist

Hi,

you can download an external plugin called QVPlus, you have the possibility to export variables from there.

svsudhakar
Creator
Creator
Author

Hi Jonathan,

Thanks for your quick response.

I am getting an error while executing the above script,

could you please provide me an sample application for this.

Regards,

Sudhakar

svsudhakar
Creator
Creator
Author

Hi Shamshunnisa,

I have created all the variables through variable overview -->setting option.

could you please tell me how can I export the variable script to import in other application.

regards,

sudhakar

Not applicable

The code given by Jonathan is working. You should replace 'C:\Projects\Project1\Model.qvw';  as per your required file path. Hope you have done that. We can help you if can share the error message or the application with us.

Attaching files for your reference. Variables in Sales dashboard-copy.qvw are extracted to variables.qvw file.

Shameem.