<?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 Selection and variable, same source, different results? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374718#M1176263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use the variable you are not considering the relationship between cBeginDate and TransDate so you compare 1 cBeginDate with your TransDate.&amp;nbsp; If you use the field, the problem might be that there are 2 cBeginDate related to ProductCode so QV is confused and double counts the number of transactions that are less than cBeginDate.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to fix this is to assign a Campaign ID code in the Sales table so that you would have 1-to-1 relationship between cBeginDate and TransDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Mar 2012 15:05:04 GMT</pubDate>
    <dc:creator>pover</dc:creator>
    <dc:date>2012-03-29T15:05:04Z</dc:date>
    <item>
      <title>Selection and variable, same source, different results?</title>
      <link>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374715#M1176260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="question1.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/12527_question1.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Theres two listboxes containing campain name and sales, but one multiplies it by two for some reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same campain, two different results. First sum is calculated like this:&lt;/P&gt;&lt;P&gt;=Sum(if(TransDate &amp;gt;=cBeginDate AND TransDate &amp;lt;=cEndDate ,Quantity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the second like this:&lt;/P&gt;&lt;P&gt;=Sum(if(TransDate &amp;gt;=$(vcBeginDate) AND TransDate &amp;lt;=$(vcEndDate) ,Quantity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables vcBeginDate and vcEndDate are set from click action like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(GetPossibleCount(cBeginDate)=0,min(TransDate),cBeginDate)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;=if(GetPossibleCount(cEndDate)=0,max(TransDate),cEndDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first listbox name is calculated from selection and the second from variable, so they are both the same...&lt;/P&gt;&lt;P&gt;Then why is the result from the first listbox 2 times greater?&lt;/P&gt;&lt;P&gt;I can use /2 on the first one and get a correct answer but its impractical and i want to understand why it's doing that &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n advance &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 20:13:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374715#M1176260</guid>
      <dc:creator />
      <dc:date>2012-03-28T20:13:26Z</dc:date>
    </item>
    <item>
      <title>Selection and variable, same source, different results?</title>
      <link>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374716#M1176261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a relation between TransDate and cBeginDate in the data model?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 21:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374716#M1176261</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2012-03-28T21:31:26Z</dc:date>
    </item>
    <item>
      <title>Selection and variable, same source, different results?</title>
      <link>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374717#M1176262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="question2.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/12537_question2.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Thanks for quick reply Karl, &lt;/P&gt;&lt;P&gt;Yes, through Product code. There is a synthetic table in the equasion because one table had two common fields with rest of the tables, TransDate and ProductCode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 05:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374717#M1176262</guid>
      <dc:creator />
      <dc:date>2012-03-29T05:44:12Z</dc:date>
    </item>
    <item>
      <title>Selection and variable, same source, different results?</title>
      <link>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374718#M1176263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use the variable you are not considering the relationship between cBeginDate and TransDate so you compare 1 cBeginDate with your TransDate.&amp;nbsp; If you use the field, the problem might be that there are 2 cBeginDate related to ProductCode so QV is confused and double counts the number of transactions that are less than cBeginDate.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to fix this is to assign a Campaign ID code in the Sales table so that you would have 1-to-1 relationship between cBeginDate and TransDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 15:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374718#M1176263</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2012-03-29T15:05:04Z</dc:date>
    </item>
    <item>
      <title>Selection and variable, same source, different results?</title>
      <link>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374719#M1176264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Karl. It indeed occurs only with products that have more then one cBeginDate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 06:03:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selection-and-variable-same-source-different-results/m-p/374719#M1176264</guid>
      <dc:creator />
      <dc:date>2012-03-30T06:03:16Z</dc:date>
    </item>
  </channel>
</rss>

