<?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: Measure to count distinct value, comparing dates but ignoring relations in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765045#M59162</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you for your reply. I have tried your solution but the result is not as I expected or maybe I misunderstood.&lt;/P&gt;&lt;P&gt;Here the result&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schermata 2020-11-28 alle 11.00.31.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/44954i3F7DFCFC233FC340/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermata 2020-11-28 alle 11.00.31.png" alt="Schermata 2020-11-28 alle 11.00.31.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Consider that I want to create a chart like 'chart n.1' in the picture: I want ticket_date on x-axis and ticket count and shipment count on y-axis.&lt;/P&gt;&lt;P&gt;If I put ticket_date on the x-axis, then the count of ID_SHIPMENT_DETAIL is not correct because returns 2, when it should return 3, because I have 3 shipments in 09/2020.&lt;/P&gt;&lt;P&gt;If I put DATE on the x-axis I have the correct results, but I don't think it's right, because DATE refers to shipments and not to tickets.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Sat, 28 Nov 2020 10:09:05 GMT</pubDate>
    <dc:creator>danette</dc:creator>
    <dc:date>2020-11-28T10:09:05Z</dc:date>
    <item>
      <title>Measure to count distinct value, comparing dates but ignoring relations</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1764995#M59156</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to develop a chart but I am not able to build a measure in the way I desire.&lt;/P&gt;&lt;P&gt;Consider these two tables:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schermata 2020-11-27 alle 16.55.42.png" style="width: 473px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/44941iF8B817055DD98D9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermata 2020-11-27 alle 16.55.42.png" alt="Schermata 2020-11-27 alle 16.55.42.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;they are connected through ID_USER.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to count the distinct id_shipment_detail where DATE=DATE_TICKET.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With this measure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;count(distinct if ( DATE=DATE_TICKET ,ID_SHIPMENT_DETAIL))&lt;/P&gt;&lt;P&gt;it seems to me that the count considers the condition DATE=DATE_TICKET but excludes from the count the row with 'user4' (i believe it is because user4 is not in tableB).&lt;/P&gt;&lt;P&gt;How can I count the total of distinct ID_SHIPMENT_DETAIL, considering the comparison between dates and also including the rows of table A that have no connection with table B?&lt;/P&gt;&lt;P&gt;At the end, if I print a table with DATE, DATE_TICKET and the count measure, I want to obtain the following:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schermata 2020-11-27 alle 16.59.10.png" style="width: 220px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/44942i07252DC2B89A92FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermata 2020-11-27 alle 16.59.10.png" alt="Schermata 2020-11-27 alle 16.59.10.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1764995#M59156</guid>
      <dc:creator>danette</dc:creator>
      <dc:date>2024-11-16T01:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct value, comparing dates but ignoring relations</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765027#M59160</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/130548"&gt;@danette&lt;/a&gt;&amp;nbsp; you can create a Flag in script like below. Add below piece of code in script after loading table A &amp;amp; table B&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;left join (TableA)
LOAD fieldvalue('DATE_TICKET',recno()) as DATE,
     1 as Flag
autogenerate fieldvaluecount('DATE_TICKET');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;DATE_TICKET&lt;/STRONG&gt; is field name from table B and &lt;STRONG&gt;DATE&lt;/STRONG&gt; is field name of Table A. So that join with table A will be performed on DATE field from both table.&lt;/P&gt;&lt;P&gt;Now, you can use below expression to count the value&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;count(distinct {&amp;lt;Flag={1}&amp;gt;}ID_SHIPMENT_DETAIL)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 28 Nov 2020 00:53:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765027#M59160</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-11-28T00:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct value, comparing dates but ignoring relations</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765045#M59162</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you for your reply. I have tried your solution but the result is not as I expected or maybe I misunderstood.&lt;/P&gt;&lt;P&gt;Here the result&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schermata 2020-11-28 alle 11.00.31.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/44954i3F7DFCFC233FC340/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermata 2020-11-28 alle 11.00.31.png" alt="Schermata 2020-11-28 alle 11.00.31.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Consider that I want to create a chart like 'chart n.1' in the picture: I want ticket_date on x-axis and ticket count and shipment count on y-axis.&lt;/P&gt;&lt;P&gt;If I put ticket_date on the x-axis, then the count of ID_SHIPMENT_DETAIL is not correct because returns 2, when it should return 3, because I have 3 shipments in 09/2020.&lt;/P&gt;&lt;P&gt;If I put DATE on the x-axis I have the correct results, but I don't think it's right, because DATE refers to shipments and not to tickets.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 10:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765045#M59162</guid>
      <dc:creator>danette</dc:creator>
      <dc:date>2020-11-28T10:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct value, comparing dates but ignoring relations</title>
      <link>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765060#M59166</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/130548"&gt;@danette&lt;/a&gt;&amp;nbsp; putting DATE as x-axis is not incorrect because you are joining DATE_TICKET to that table and Flagging according to the matched DATE_TICKET. So basically, you are counting the shipment for DATE_TICKET only.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 15:54:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Measure-to-count-distinct-value-comparing-dates-but-ignoring/m-p/1765060#M59166</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-11-28T15:54:03Z</dc:date>
    </item>
  </channel>
</rss>

