<?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: Count difference in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243609#M872940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no reason why I don't want join the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new about qlik world, and I'm exploring the alternative solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank to all for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Nov 2016 15:07:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-11-15T15:07:15Z</dc:date>
    <item>
      <title>Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243602#M872933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;​Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I need of your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three table, travel, option_A and option_B.&lt;/P&gt;&lt;P&gt;Travel is the main table, and it's connected by specific to the other two table.&lt;/P&gt;&lt;P&gt;The table travel have the field destination, while option_A have price_A and option_B have price_B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I would know for every destination the number of situation in which price_A &amp;lt;&amp;gt; price_B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(price_A &amp;lt;&amp;gt; price_B)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243602#M872933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243603#M872934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,. Why don't you link the option A and Option B table with main table using left join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you join them, you will have both fields PriceA and PriceB in same table, then you can take resident of the table and use if statement like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(PriceA&amp;lt;&amp;gt;PriceB,1,0) as flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then use this flag field to count like Sum(flag)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 09:49:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243603#M872934</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2016-11-14T09:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243604#M872935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you please post sample data so that a much better suggestion/solution could be provided.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 12:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243604#M872935</guid>
      <dc:creator>saimahasan</dc:creator>
      <dc:date>2016-11-14T12:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243605#M872936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case you don't want to join, you can always do like this in the front end, but I agree with &lt;A href="https://community.qlik.com/people/kaushik.solanki"&gt;kaushik.solanki&lt;/A&gt;‌ that if joining is an option, I would do this 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;&lt;STRONG&gt;Sum(if(price_A &amp;lt;&amp;gt; price_B, 1, 0))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 16:24:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243605#M872936</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-14T16:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243606#M872937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used &lt;SPAN class="j-post-author"&gt;&lt;SPAN class="jiveTT-hover-user jive-username-link"&gt;&lt;STRONG&gt;Kaushik Solanki&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;'&lt;/STRONG&gt;s solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My new question is, there is another way to do the same thing but without create other columns in the table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I give you my old schema, maybe it can help to understand my questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="schema.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/143853_schema.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 16:36:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243606#M872937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-14T16:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243607#M872938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want to make data model changes, try Sunny's solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I guess I'd then ask why you didn't want to join the three tables together. Does it cause a problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mind you, I wouldn't want to join them together either, but I wouldn't leave them as is either. I'd probably go with a rather different data structure allowing for 0 to many companies to provide prices for a given destination, and interpret your question as "how many destinations have more than one distinct price?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Travel:&lt;BR /&gt;destination&lt;BR /&gt;description&lt;BR /&gt;target&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Offers:&lt;BR /&gt;destination&lt;BR /&gt;company&lt;BR /&gt;price&lt;BR /&gt;time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I think this expression would answer that question using that data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;-sum(aggr(count(distinct price)&amp;gt;1,destination))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 00:36:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243607#M872938</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-11-15T00:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243608#M872939</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;&amp;nbsp;&amp;nbsp; Following expression will work for your data model. Use this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = -sum(aggr(count(distinct price)&amp;gt;1,destination))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 03:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243608#M872939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-15T03:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243609#M872940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no reason why I don't want join the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new about qlik world, and I'm exploring the alternative solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank to all for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 15:07:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243609#M872940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-15T15:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count difference</title>
      <link>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243610#M872941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, if you're open to data model changes, then building what I was suggesting might go something like this. You could alternatively get a crosstable load involved in here, but I'm going to skip that for now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Travel:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; destination&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,description&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,target&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM your raw travel data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Offers:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; destination&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,id_offer_A as offer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM your raw travel data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN (Offers)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; id_offer_A as offer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,company_A as company&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,price_A as price&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,time_A as time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM your raw offer A data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;OffersB:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; destination&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,id_offer_B as offer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM your raw travel data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN (Offers)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; id_offer_B as offer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,company_B as company&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,price_B as price&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,time_B as time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM your raw offer B data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CONCATENATE (Offers)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT OffersB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE OffersB;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 16:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-difference/m-p/1243610#M872941</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-11-15T16:56:57Z</dc:date>
    </item>
  </channel>
</rss>

