<?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 Re: Very simple calculation - why can't I make it into an e_variable? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913465#M316904</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more question. This works fine so far - I have used the TOTAL option in that expression, but the expression is not independent of user selections.&lt;/P&gt;&lt;P&gt;That is important in case there is a subset of the data that I need to use selections to get - and I want to analyze it further. That wouldn't work if user_selections were generally being ignored.&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; But the way it is now, as soon as I select one value in a listbox, the percentage jumps to 100%. Of course.&lt;/P&gt;&lt;P&gt;=&amp;gt; I would like to avoid this by making the expression independent of selections in that specific listbox (the one the expression is being used in), but to react to user_selections elsewhere.&lt;/P&gt;&lt;P&gt;Can that be done without again breaking the point of using the expression in a qvs file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Aug 2015 07:45:36 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2015-08-07T07:45:36Z</dc:date>
    <item>
      <title>Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913458#M316897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one very simple expression that I have found to be extremely useful in analyzing trends and similarities among my data and that I add to nearly all my listboxes these days is&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; num((COUNT([countfield]) / COUNT(TOTAL [countfield])), '#.##0,00 %') &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;=&amp;gt; That is quite simply the relative percentage of my records that have a specific value in that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just now I'm trying to make that into an e_variable to store in a qvs file so that I can easily add it in all my apps. however, there must be something tricky.&lt;/P&gt;&lt;P&gt;I first tried to make a local variable of the countfield which I certainly need to set as a parameter to this expression. I did that in the variable_manager at first, without quotes or anything.&lt;/P&gt;&lt;P&gt;However, when I try to put that into the expression, I get completely different - and impossible - values (like 300%).&lt;/P&gt;&lt;P&gt;Now I realized that maybe I do need to define the variable with quotes, but that doesn't work either.&lt;/P&gt;&lt;P&gt;Obviously I am doing something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My objective is to write an expression in a qvs file to INCLUDE that will combine with another variable that must exist locally to denote the field to count. I know that works in principle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me there?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 09:01:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913458#M316897</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-08-06T09:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913459#M316898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A script file with this line should create your variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET e_varibale = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;num((COUNT([countfield]) / COUNT(TOTAL [countfield])), '#.##0,00 %');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 09:17:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913459#M316898</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-08-06T09:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913460#M316899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, I still cannot do it.&lt;/P&gt;&lt;P&gt;I can go like &amp;gt;&amp;gt; SET v_countfield = 'FKolli_ID'; &amp;lt;&amp;lt; in the script, that generates me a variable that i can display without quotes or anything on the GUI - with the $() it doesn't work, though - with quotes (like &amp;gt;&amp;gt; '$(v_countfield)' &amp;lt;&amp;lt; it works, but then it's just the same result-wise - I get completely impossible values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining both that variable and the expression in the script like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; LET &lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;e_percentage_countfield&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('$(v_countfield)') / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; '$(v_countfield)')), '#.##0,00 %');&amp;nbsp; &amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;does not seem to work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 09:39:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913460#M316899</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-08-06T09:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913461#M316900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, no. Because dollar expansion also happens in the script. Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET e_percentage_countfield = num((COUNT('@(v_countfield)') / COUNT(TOTAL '@(v_countfield)')), '#.##0,00 %');&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET e_percentage_countfield = replace(e_percentage_countfield,'@','$');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 09:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913461#M316900</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-08-06T09:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913462#M316901</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;sounds like a good idea. I'll try tomorrow - for the rest of today I have something different to do.&lt;/P&gt;&lt;P&gt;Right now, QlikView is reporting an error with a ',' which is a bit strange because I (should) have only distinct values there, no comma_values.&lt;/P&gt;&lt;P&gt;Well, I'll see about that tomorrow.&lt;/P&gt;&lt;P&gt;Thanks and have a nice day!&lt;/P&gt;&lt;P&gt;I'll be back here if I need any more help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 09:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913462#M316901</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-08-06T09:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913463#M316902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have implemented the formula like you proposed it now. It seems to work - but when I put &amp;gt;&amp;gt; = $(e_percentage) &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;in the listbox, I get for the first value there a result of 2.500,00 % while the true value should be about 0.01% (with no selection, the count is 25, ringring) - so there is something wrong with my separator signs - but what?&lt;/P&gt;&lt;P&gt;My thousand_separator in the script is the '.', the decimal_separator is the ',', and that's just how I have made up the num() function in that expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So do I have to wrap that into a num#() function to turn those around so that they match QlikView's internal calculating_engine?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 13:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913463#M316902</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-08-06T13:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913464#M316903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I got it. Well, it was quite easy to locate the error given the count of the first value is 250 and I got something like 2.500,00 % - so the error was in the definition of my variable v_countfield.&lt;/P&gt;&lt;P&gt;Now I have the definition of that with no quotes, like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; SET v_countfield = FKolli_ID &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;in the script (FKolli_ID is the field I count) and now it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 14:17:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913464#M316903</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-08-06T14:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Very simple calculation - why can't I make it into an e_variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913465#M316904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more question. This works fine so far - I have used the TOTAL option in that expression, but the expression is not independent of user selections.&lt;/P&gt;&lt;P&gt;That is important in case there is a subset of the data that I need to use selections to get - and I want to analyze it further. That wouldn't work if user_selections were generally being ignored.&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; But the way it is now, as soon as I select one value in a listbox, the percentage jumps to 100%. Of course.&lt;/P&gt;&lt;P&gt;=&amp;gt; I would like to avoid this by making the expression independent of selections in that specific listbox (the one the expression is being used in), but to react to user_selections elsewhere.&lt;/P&gt;&lt;P&gt;Can that be done without again breaking the point of using the expression in a qvs file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 07:45:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Very-simple-calculation-why-can-t-I-make-it-into-an-e-variable/m-p/913465#M316904</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-08-07T07:45:36Z</dc:date>
    </item>
  </channel>
</rss>

