<?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 Lock variable value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869734#M470485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am busy building a dashboard where I am trying to lock the value of a variable. I have tried everything, from the {1} to doing the "variable=" in my set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is, I don't want to have to list all of the possible filters that might affect my calculation and the {1} does not seem to lock the value when I click on a filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable that I have created looks as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTotalCost&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;*&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vInsurance&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;100)/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;= {'Insurance'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;txn&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-= {''}&amp;gt;} txn) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Basically, an individual must choose how much they feel that Insurance contributes to the total cost. Let's say the total cost is 10, then insurance contributes 6 to that, so 60%.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Then I want to count the number of transactional lines where the product is Insurance, so that I can calculate a cost per insurance txn.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want to fix that value, like in Excel where you put the $ signs around a cell value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Then I want to be able to call this value in my Qlikview at any time and be able to for example, calculate the number of txns that Males have on the Insurance product and understand that if the average txn cost for Insurance is 3, and Males have 10 Insurance transactions, then the total cost of Male contributions to Insurance is 30..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want this to be fixed so that it does not matter in which way I slice or dice my chart, it will always use the precalculated value of the cost per txn and I can apply it across the board.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you for your help - I have googled and have struggled to find a solution...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 May 2015 14:00:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-15T14:00:34Z</dc:date>
    <item>
      <title>Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869734#M470485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am busy building a dashboard where I am trying to lock the value of a variable. I have tried everything, from the {1} to doing the "variable=" in my set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is, I don't want to have to list all of the possible filters that might affect my calculation and the {1} does not seem to lock the value when I click on a filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable that I have created looks as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vTotalCost&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;*&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;vInsurance&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;100)/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;= {'Insurance'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;txn&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-= {''}&amp;gt;} txn) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Basically, an individual must choose how much they feel that Insurance contributes to the total cost. Let's say the total cost is 10, then insurance contributes 6 to that, so 60%.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Then I want to count the number of transactional lines where the product is Insurance, so that I can calculate a cost per insurance txn.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want to fix that value, like in Excel where you put the $ signs around a cell value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Then I want to be able to call this value in my Qlikview at any time and be able to for example, calculate the number of txns that Males have on the Insurance product and understand that if the average txn cost for Insurance is 3, and Males have 10 Insurance transactions, then the total cost of Male contributions to Insurance is 30..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want this to be fixed so that it does not matter in which way I slice or dice my chart, it will always use the precalculated value of the cost per txn and I can apply it across the board.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you for your help - I have googled and have struggled to find a solution...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 14:00:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869734#M470485</guid>
      <dc:creator />
      <dc:date>2015-05-15T14:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869735#M470486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #808080; font-size: 8pt; font-family: inherit; font-weight: inherit;"&gt;&lt;EM&gt;vTotalCost&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; and &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #808080; font-size: 8pt; font-family: inherit; font-weight: inherit;"&gt;&lt;EM&gt;vInsurance&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;100&lt;/SPAN&gt;? Those look like variables too. Do these variables also contain expressions that can be influenced by selections?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 15:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869735#M470486</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-15T15:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869736#M470487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for responding - no, these are just input variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTotalCost can be 1000 for example and vInsurance can be 65. These are sliders...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oops, the equation should be:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vTotalCost&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;*&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vInsurance/&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;100)/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Product&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;= {'Insurance'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;txn&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-= {''}&amp;gt;} txn)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 08:46:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869736#M470487</guid>
      <dc:creator />
      <dc:date>2015-05-17T08:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869737#M470488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not really sure about the expression syntax you are using. Does it work if you put the entire set 1 inside the second one? Like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: courier new,courier;"&gt;=(&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vTotalCost&lt;/EM&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vInsurance/&lt;/EM&gt;&lt;/STRONG&gt;100)/&lt;SPAN style="color: #0000ff;"&gt;count&lt;/SPAN&gt;({&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;={'Insurance'}, &lt;SPAN style="color: #800000;"&gt;txn&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: courier new,courier;"&gt;-={''}&amp;gt;} txn)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 08:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869737#M470488</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-05-17T08:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869738#M470489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another idea: why count the number of transactions over and over again if this value remains constant? You could calculate a variable say &lt;SPAN style="font-family: courier new,courier;"&gt;vNoOfInsuranceTransactions&lt;/SPAN&gt; in your Load script and use that one in expressions like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;=(vTotalCost * vInsurance) / (100 * vNoOfInsuranceTransactions)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 08:59:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869738#M470489</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-05-17T08:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869739#M470490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will only be able to test this tomorrow, as the model is on the server at work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't mind doing that, that will make the model faster, but my concern is if that will lock down the value of the cost per insurance transaction that I am calculating above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem that I experience, is that let's say I have 5 products, Insurance, Wealth, Health, Short Term and Risk, and each of these take 20% of the total cost, so $200. Now, I want to segment the above mentioned calculated costs by Income Brackets, when I filter on income brackets, the total cost gets allocated to the income bracket that I have filtered to... So I want to fix the cost per transaction to be constant after the sliders have been applied... and obviously the sliders needs to be able to change according to the user's discretion..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data is currently only in one flat table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I made sense &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 09:20:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869739#M470490</guid>
      <dc:creator />
      <dc:date>2015-05-17T09:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869740#M470491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's why in my example variable &lt;SPAN style="font-family: courier new,courier;"&gt;vNoOfInsuranceTransactions&lt;/SPAN&gt; only contains a precalculated count, not the entire expression. Using set {1} means that the count is immune to all selections except the ones you supply in the set modifier. That count can be translated 1:1 into a &lt;SPAN style="font-family: courier new,courier;"&gt;LOAD COUNT() WHERE TX='Insurance';&lt;/SPAN&gt; script statement.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You see I adhere to an old motto: "Everything that can be done in the script, should be done in the script" &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 09:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869740#M470491</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-05-17T09:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lock variable value</title>
      <link>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869741#M470492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Peter - this worked &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; we also changed the set analysis to a count if statement and this made our data "sliceable" &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 11:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lock-variable-value/m-p/869741#M470492</guid>
      <dc:creator />
      <dc:date>2015-05-19T11:41:24Z</dc:date>
    </item>
  </channel>
</rss>

