<?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: Graph Fields after and before a firstsortedvalue date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263659#M25802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not entirely sure what you are trying to get. Would you be able to share a sample with the expected output to help you better?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2016 00:59:28 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-11-17T00:59:28Z</dc:date>
    <item>
      <title>Graph Fields after and before a firstsortedvalue date</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263658#M25801</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;My data inputs is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; device,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(fec_recep, 'MM/DD/YYYY hh:mm:ss') as Fecha_recep,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; event_name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(List,'DG') as CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(fec_recep, 'MM/DD/YYYY hh:mm:ss') as fechaCODE&lt;/P&gt;&lt;P&gt;FROM [lib://MSG/*.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Those List is a concatenated list of CODE's and came only in an specific event_name, not all event_names has it. That is why I made a subfield in order to split the list of CODE's&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have this graph of the CODE's for an specific device:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="144073" alt="CODE_graph1.PNG" class="jive-image image-1" height="150" src="https://community.qlik.com/legacyfs/online/144073_CODE_graph1.PNG" style="height: 150.256px; width: 280px;" width="280" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the previous graph:&lt;/P&gt;&lt;P&gt;Dimention: CODE&lt;/P&gt;&lt;P&gt;Measure: Count(CODE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to graph the CODE's that were generated (fechaCODE) before the first date of an specific event name of every device:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;Dimention: CODE&lt;/P&gt;&lt;P&gt;Measure: COUNT(AGGR(if(fechaCODE&amp;lt; FirstSortedValue(AGGR({$&amp;lt;event_name={"*SpecificEvent*"}&amp;gt;} Fecha_recep,device),Fecha_recep,1),CODE),CODE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried to make the same graph but with those CODE's created just before &lt;SPAN style="font-size: 13.3333px;"&gt;FirstSortedValue(AGGR({$&amp;lt;event_name={"*SpecificEvent*"}&amp;gt;} Fecha_recep,device),Fecha_recep,1).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I make a table of CODE and &lt;SPAN style="font-size: 13.3333px;"&gt;FirstSortedValue(AGGR({$&amp;lt;event_name={"*SpecificEvent*"}&amp;gt;} Fecha_recep,device),Fecha_recep,1), IT WORKS:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="144092" alt="date1.PNG" class="jive-image image-2" height="99" src="https://community.qlik.com/legacyfs/online/144092_date1.PNG" style="height: 99.3939px; width: 205px;" width="205" /&gt;&lt;/P&gt;&lt;P&gt;And I want just to count the CODE's in order to test the Measure and does not works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count is: count(aggr(If(fechaCODE&amp;lt; firstsortedvalue({$&amp;lt;event_name={"*Specific Event*"}&amp;gt;} Fecha_recep , Fecha_recep,1), fechaCODE),device,CODE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="144093" alt="date2.PNG" class="jive-image image-3" height="60" src="https://community.qlik.com/legacyfs/online/144093_date2.PNG" style="height: 59.9417px; width: 126px;" width="126" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an input data example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="268"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" width="67"&gt;device&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="67"&gt;event_name&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="67"&gt;List&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="67"&gt;fec_recep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGXDGYDGZ&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;01-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;02-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;03-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;04-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGXDGZ&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;05-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGXDGZ&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;06-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGXDGZ&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;02-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGXDGZDGW&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;03-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGXDGZDGW&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;04-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;05-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;06-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGX&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;05-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGX&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;06-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGX&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;07-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGX&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;08-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGX&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;09-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;17-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;18-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;19-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGZ&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;20-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;serial4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;Event1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;DGX&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;21-01-16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I load the data like this because "list" has the Codes concatenated:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; device,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; event_name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(fec_recep, 'MM/DD/YYYY hh:mm:ss') as Fecha_recep,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(List,'DG') as CODE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(fec_recep, 'MM/DD/YYYY hh:mm:ss') as fechaCODE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM [lib://test/data.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could make this graph&amp;nbsp; with&lt;/P&gt;&lt;P&gt;Dimention: CODE&lt;/P&gt;&lt;P&gt;Measurement: COUNT(CODE)&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="144100" alt="CODES.PNG" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/144100_CODES.PNG" style="height: 209px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I want to count only the CODEs that were generated before the oldest Event 2 date,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The graph I need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;IMG __jive_id="144101" alt="CODES2.PNG" class="image-5 jive-image" src="https://community.qlik.com/legacyfs/online/144101_CODES2.PNG" style="height: 236px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Dimention: CODE&lt;/P&gt;&lt;P&gt;Measure: COUNT(AGGR(if(fechaCODE&amp;lt; FirstSortedValue(AGGR({$&amp;lt;event_name={"Event2"}&amp;gt;} Fecha_recep,device),Fecha_recep,1),CODE),CODE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: JUAN villalva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2016 22:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263658#M25801</guid>
      <dc:creator>juanpv20</dc:creator>
      <dc:date>2016-11-16T22:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Fields after and before a firstsortedvalue date</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263659#M25802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not entirely sure what you are trying to get. Would you be able to share a sample with the expected output to help you better?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2016 00:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263659#M25802</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-17T00:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Fields after and before a firstsortedvalue date</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263660#M25803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, thanks for the replay. I edited and added more info above&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2016 01:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263660#M25803</guid>
      <dc:creator>juanpv20</dc:creator>
      <dc:date>2016-11-17T01:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Fields after and before a firstsortedvalue date</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263661#M25804</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;Sum(Aggr(If(Max(TOTAL &amp;lt;device&amp;gt; {&amp;lt;event_name = {'Event2'}&amp;gt;} Fecha_recep)&amp;gt;= Fecha_recep or Len(Trim(Max(TOTAL &amp;lt;device&amp;gt; {&amp;lt;event_name = {'Event2'}&amp;gt;} Fecha_recep))) = 0, 1, 0), device, event_name, CODE, Fecha_recep))&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/144132_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2016 10:46:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-Fields-after-and-before-a-firstsortedvalue-date/m-p/1263661#M25804</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-11-17T10:46:05Z</dc:date>
    </item>
  </channel>
</rss>

