<?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 Count records if values in Field1 are greater than values in Field2 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12138#M1968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;a bit of advice on the below would be greatly appreciated please. The data/code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Set NullInterpret = '';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;Item,Field1,Field2&lt;/P&gt;&lt;P&gt;A,1,1&lt;/P&gt;&lt;P&gt;B,1,2&lt;/P&gt;&lt;P&gt;C,2,2&lt;/P&gt;&lt;P&gt;D,2,3&lt;/P&gt;&lt;P&gt;E,3,3&lt;/P&gt;&lt;P&gt;F,,3]; //null value in Field1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to create a pivot with &lt;STRONG&gt;Field1 as dimension&lt;/STRONG&gt; and the &lt;STRONG&gt;expression should count all records with Field2 value &amp;gt;= current dimension value of Field1&lt;/STRONG&gt;. Field1 may have nulls and these need to be hidden in dimension.&lt;/P&gt;&lt;P&gt;The outcome should be as the first two columns below, I only added explanations in the 3rd column:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="111" style="border: 1px solid rgb(0, 0, 0); width: 679px; height: 113px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Record Count&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;explanation: all records with Field2&amp;nbsp; &amp;gt;= current Field1 dimension value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;all records meet criterium of Field2&amp;gt;=1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;only record A does not meet criterium Field2&amp;gt;=2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;records D, E, F meet criterium &lt;SPAN style="font-size: 13.3333px;"&gt;Field2&amp;gt;=3&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis + aggr won't work because set is evaluated at chart level and not record level so no point in quoting Field1 in set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried As-Of-Table technique but I cannot figure out how to link the two fields together there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated. I was looking for threads on similar problems but i could not find anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Mar 2018 15:17:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-26T15:17:20Z</dc:date>
    <item>
      <title>Count records if values in Field1 are greater than values in Field2</title>
      <link>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12138#M1968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;a bit of advice on the below would be greatly appreciated please. The data/code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Set NullInterpret = '';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;Item,Field1,Field2&lt;/P&gt;&lt;P&gt;A,1,1&lt;/P&gt;&lt;P&gt;B,1,2&lt;/P&gt;&lt;P&gt;C,2,2&lt;/P&gt;&lt;P&gt;D,2,3&lt;/P&gt;&lt;P&gt;E,3,3&lt;/P&gt;&lt;P&gt;F,,3]; //null value in Field1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to create a pivot with &lt;STRONG&gt;Field1 as dimension&lt;/STRONG&gt; and the &lt;STRONG&gt;expression should count all records with Field2 value &amp;gt;= current dimension value of Field1&lt;/STRONG&gt;. Field1 may have nulls and these need to be hidden in dimension.&lt;/P&gt;&lt;P&gt;The outcome should be as the first two columns below, I only added explanations in the 3rd column:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="111" style="border: 1px solid rgb(0, 0, 0); width: 679px; height: 113px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Record Count&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;explanation: all records with Field2&amp;nbsp; &amp;gt;= current Field1 dimension value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;all records meet criterium of Field2&amp;gt;=1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;only record A does not meet criterium Field2&amp;gt;=2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;records D, E, F meet criterium &lt;SPAN style="font-size: 13.3333px;"&gt;Field2&amp;gt;=3&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis + aggr won't work because set is evaluated at chart level and not record level so no point in quoting Field1 in set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried As-Of-Table technique but I cannot figure out how to link the two fields together there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated. I was looking for threads on similar problems but i could not find anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:17:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12138#M1968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-26T15:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count records if values in Field1 are greater than values in Field2</title>
      <link>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12139#M1969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SubStringCount(Mid(Concat(TOTAL Field2, '|', Field2), Index(Concat(TOTAL Field2, '|', Field2), Field1)), '|') + 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/197500_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12139#M1969</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-03-26T15:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Count records if values in Field1 are greater than values in Field2</title>
      <link>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12140#M1970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load below in your script...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Load Distinct Field1 as F1 Resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now create a straight or pivot table&lt;/P&gt;&lt;P&gt;Dimension&lt;/P&gt;&lt;P&gt;F1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;SUM(Aggr(NODISTINCT IF(Field2 &amp;gt;= F1, 1, 0),Field2,F1))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:44:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-records-if-values-in-Field1-are-greater-than-values-in/m-p/12140#M1970</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2018-03-26T15:44:50Z</dc:date>
    </item>
  </channel>
</rss>

