<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article How to recover variables values from PRJ folder in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/How-to-recover-variables-values-from-PRJ-folder/ta-p/1711061</link>
    <description>&lt;P&gt;QlikView's project&amp;nbsp;(PRJ)&amp;nbsp;folder does not include data, which means that data stored in the QVW file's data model, as well as variable values, are lost when an application is restored from the PRJ folder.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The data in the data model will be restored once the restored QVW file is reloaded. In the same way, variables defined in the load script will be restored.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Variables that have been defined in QlikView desktop client's variable overview section will not be restored as they are not part of the load script.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H3 class="qlik-migrated-tkb-headings"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;H5&gt;&lt;BR /&gt;Variable values are not stored in the project folder XML files, hence it is not possible to recover them if the QVW file gets deleted or corrupted.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To prevent the loss of variable values, the current variables can be exported to a QVD during application reload. The QVD can then later be used to recover the previous variable values.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Store all application variables to QVD file&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The below script loads all defined variables from the&amp;nbsp;AllProperties.XML&amp;nbsp;file in the QlikView project (PRJ) folder. This script should be loaded along with the application linked to the PRJ folder, since the variable values are stored in that QVW file.&amp;nbsp;All the variables found in the AllProperties.XML are extracted and stored into a QVD file called&amp;nbsp;Variables.qvd.&amp;nbsp;&lt;/H5&gt;
&lt;H5&gt;For information on how to use the PRJ folder, see &lt;A href="https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/QlikView_Project_Files.htm" target="_blank" rel="noopener"&gt;QlikView Project Files&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;To be on the safe side this script could be included all reloads so that the variables can be restored even if the QVW file gets corrupted or deleted.&amp;nbsp;&lt;/H5&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VariableNames:
LOAD Name AS VariableName
FROM [MyApplication-prj\AllProperties.xml] (XmlSimple, Table is [AllProperties/VariableProperties/VariableProperties]);

FOR i=0 TO NoOfRows('VariableNames')

    LET varName = Peek('VariableName', $(i), 'VariableNames');           
    LET varValue = $(varName);
          
   Variables:
   LOAD
      '$(varName)' AS VariableName,
      '$(varValue)' AS VariableValue
   AutoGenerate 1;                     

NEXT

STORE Variables INTO Variables.qvd (QVD);

DROP Tables VariableNames, Variables;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Restore all application variables from a QVD file&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The variables stored in the QVD file in the above example can be restored by the principle below. The QVD is loaded and then the variables are picked out one by one and defined in the application. This script should only be executed on loads where the variables should be recovered.&amp;nbsp;&amp;nbsp;&lt;/H5&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variables:
LOAD VariableName,
     VariableValue
FROM Variables.qvd (qvd);


FOR i=0 TO NoOfRows('Variables')

            LET vVar = Peek('VariableName', $(i), 'Variables');
            LET vVal = Peek('VariableValue', $(i), 'Variables');
           
            LET '$(vVar)' = '$(vVal)';

NEXT &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 09:41:49 GMT</pubDate>
    <dc:creator>ToniKautto</dc:creator>
    <dc:date>2022-09-21T09:41:49Z</dc:date>
    <item>
      <title>How to recover variables values from PRJ folder</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/How-to-recover-variables-values-from-PRJ-folder/ta-p/1711061</link>
      <description>&lt;P&gt;QlikView's project&amp;nbsp;(PRJ)&amp;nbsp;folder does not include data, which means that data stored in the QVW file's data model, as well as variable values, are lost when an application is restored from the PRJ folder.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The data in the data model will be restored once the restored QVW file is reloaded. In the same way, variables defined in the load script will be restored.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Variables that have been defined in QlikView desktop client's variable overview section will not be restored as they are not part of the load script.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H3 class="qlik-migrated-tkb-headings"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;H5&gt;&lt;BR /&gt;Variable values are not stored in the project folder XML files, hence it is not possible to recover them if the QVW file gets deleted or corrupted.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To prevent the loss of variable values, the current variables can be exported to a QVD during application reload. The QVD can then later be used to recover the previous variable values.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Store all application variables to QVD file&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The below script loads all defined variables from the&amp;nbsp;AllProperties.XML&amp;nbsp;file in the QlikView project (PRJ) folder. This script should be loaded along with the application linked to the PRJ folder, since the variable values are stored in that QVW file.&amp;nbsp;All the variables found in the AllProperties.XML are extracted and stored into a QVD file called&amp;nbsp;Variables.qvd.&amp;nbsp;&lt;/H5&gt;
&lt;H5&gt;For information on how to use the PRJ folder, see &lt;A href="https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/QlikView_Project_Files.htm" target="_blank" rel="noopener"&gt;QlikView Project Files&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;To be on the safe side this script could be included all reloads so that the variables can be restored even if the QVW file gets corrupted or deleted.&amp;nbsp;&lt;/H5&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VariableNames:
LOAD Name AS VariableName
FROM [MyApplication-prj\AllProperties.xml] (XmlSimple, Table is [AllProperties/VariableProperties/VariableProperties]);

FOR i=0 TO NoOfRows('VariableNames')

    LET varName = Peek('VariableName', $(i), 'VariableNames');           
    LET varValue = $(varName);
          
   Variables:
   LOAD
      '$(varName)' AS VariableName,
      '$(varValue)' AS VariableValue
   AutoGenerate 1;                     

NEXT

STORE Variables INTO Variables.qvd (QVD);

DROP Tables VariableNames, Variables;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Restore all application variables from a QVD file&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The variables stored in the QVD file in the above example can be restored by the principle below. The QVD is loaded and then the variables are picked out one by one and defined in the application. This script should only be executed on loads where the variables should be recovered.&amp;nbsp;&amp;nbsp;&lt;/H5&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variables:
LOAD VariableName,
     VariableValue
FROM Variables.qvd (qvd);


FOR i=0 TO NoOfRows('Variables')

            LET vVar = Peek('VariableName', $(i), 'Variables');
            LET vVal = Peek('VariableValue', $(i), 'Variables');
           
            LET '$(vVar)' = '$(vVal)';

NEXT &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 09:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/How-to-recover-variables-values-from-PRJ-folder/ta-p/1711061</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2022-09-21T09:41:49Z</dc:date>
    </item>
  </channel>
</rss>

