<?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>topic How not to replace the variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257937#M498344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;e.g. I have two script lines:&lt;/P&gt;&lt;P&gt;....;&lt;/P&gt;&lt;P&gt;set fSel_1=(COEP.GJAHR='$(vYr_1)' AND COEP.VERSN='$(vVersion_1)' AND COEP.WRTTP='01');&lt;/P&gt;&lt;P&gt;set fPlanJahr =Sum (if($(fSel_1),COEP.WKGBTR,0));&lt;/P&gt;&lt;P&gt;.....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want the string as it is "Sum (if($(fSel_1),COEP.WKGBTR,0))" for fPlanJahr&lt;/P&gt;&lt;P&gt;but QV replaces $(fSel_1) by the variable content of fSel_1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I force QV to handle the right side as a string without replacing?&lt;/P&gt;&lt;P&gt;Why? Because vYr_1 and vVersion_1 shall be changed by user input and the variables-hierarchy shall be interpreted during interactive reporting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using the variable editor it works fine, when creating them by script i miss the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;P&gt;set xxx = [Sum (if($(fSel_1),COEP.WKGBTR,0))];&lt;/P&gt;&lt;P&gt;set xxx = "Sum (if($(fSel_1),COEP.WKGBTR,0));";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards Eckhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Sep 2011 14:31:47 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-13T14:31:47Z</dc:date>
    <item>
      <title>How not to replace the variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257937#M498344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;e.g. I have two script lines:&lt;/P&gt;&lt;P&gt;....;&lt;/P&gt;&lt;P&gt;set fSel_1=(COEP.GJAHR='$(vYr_1)' AND COEP.VERSN='$(vVersion_1)' AND COEP.WRTTP='01');&lt;/P&gt;&lt;P&gt;set fPlanJahr =Sum (if($(fSel_1),COEP.WKGBTR,0));&lt;/P&gt;&lt;P&gt;.....;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want the string as it is "Sum (if($(fSel_1),COEP.WKGBTR,0))" for fPlanJahr&lt;/P&gt;&lt;P&gt;but QV replaces $(fSel_1) by the variable content of fSel_1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I force QV to handle the right side as a string without replacing?&lt;/P&gt;&lt;P&gt;Why? Because vYr_1 and vVersion_1 shall be changed by user input and the variables-hierarchy shall be interpreted during interactive reporting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using the variable editor it works fine, when creating them by script i miss the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;P&gt;set xxx = [Sum (if($(fSel_1),COEP.WKGBTR,0))];&lt;/P&gt;&lt;P&gt;set xxx = "Sum (if($(fSel_1),COEP.WKGBTR,0));";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards Eckhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2011 14:31:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257937#M498344</guid>
      <dc:creator />
      <dc:date>2011-09-13T14:31:47Z</dc:date>
    </item>
    <item>
      <title>How not to replace the variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257938#M498345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eckhard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set fSel_1=(COEP.GJAHR='$(vYr_1)' AND COEP.VERSN='$(vVersion_1)' AND COEP.WRTTP='01');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let &lt;/STRONG&gt;fPlanJahr =&lt;STRONG&gt;'Sum (if('&amp;amp;chr(36)&amp;amp;'(fSel_1),COEP.WKGBTR,0))';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2011 15:39:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257938#M498345</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-13T15:39:52Z</dc:date>
    </item>
    <item>
      <title>How not to replace the variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257939#M498346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option is to use a different character to denote the variable and replace the character with the dollar sign. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET fSel_1=(COEP.GJAHR='@(vYr_1)' AND COEP.VERSN='@(vVersion_1)' AND COEP.WRTTP='01');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET fSel_1=replace(fSel_1, '@', '$');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find that this is more readable especially you have many variables were you don't want the dollar-sign expansion to occur.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2011 19:56:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257939#M498346</guid>
      <dc:creator />
      <dc:date>2011-09-13T19:56:02Z</dc:date>
    </item>
    <item>
      <title>How not to replace the variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257940#M498347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, bothe helped me.&lt;/P&gt;&lt;P&gt;In the end I have something like&lt;/P&gt;&lt;DIV&gt;&lt;STRONG style="color: #00b400; font-size: 8pt;"&gt;&lt;STRONG style="color: #00b400; font-size: 8pt;"&gt;&lt;P&gt;// , replaces Komma&lt;/P&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;STRONG style="color: #00b400; font-size: 8pt;"&gt;&lt;STRONG style="color: #00b400; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;// " replaces '&lt;/P&gt;&lt;P&gt;// [ replaces (&lt;/P&gt;&lt;P&gt;// ] replaces ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting code is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #0000ff; font-size: 1;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;set&lt;SPAN style="font-size: 8pt; color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;fMonSel_1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;[$[fSel_1]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;AND&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;COEP.PERIO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;"$[SelPERIO]"];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;let&lt;SPAN style="font-size: 8pt; color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;fMonSel_1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #646464; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #646464; font-size: 8pt;"&gt;'$(fMonSel_1)'&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;']'&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;')'&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;'['&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;'('&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;'"'&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt;"&gt;chr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;39&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000;"&gt;))&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;Its not fine but the only way i found in a deep hierarchy of formula&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;﻿rgds Eckhard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 09:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-not-to-replace-the-variable/m-p/257940#M498347</guid>
      <dc:creator />
      <dc:date>2012-02-13T09:34:47Z</dc:date>
    </item>
  </channel>
</rss>

