<?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: Problem around showing a count of 2 different things through using one date in a chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-around-showing-a-count-of-2-different-things-through/m-p/1760904#M454033</link>
    <description>&lt;P&gt;Hi Helen,&lt;/P&gt;&lt;P&gt;One way to achieve what you want would be to build a canonical calendar in your script (see post&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;It would look like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;DateBridge:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Load&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#993300"&gt;ID&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Start Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;&lt;SPAN&gt;CanonicalDate&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'Start Date'&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#993300"&gt;DateType&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Resident Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Concatenate(DateBridge)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#0000FF"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#993300"&gt;ID&lt;/FONT&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Removal Date]&amp;nbsp;&lt;FONT color="#0000FF"&gt;as&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;CanonicalDate&lt;/FONT&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Removal Date'&amp;nbsp;&lt;FONT color="#0000FF"&gt;as&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;DateType&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Resident Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In parallell to DateBridge Table you can also add a Canonical Calendar which will hold all the different useful calculated time fields for Canonical Date (year, week, ... see for example the week function here&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/week.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/week.htm&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Once constructed, you can use the Canonical Date or Week in your stacked bar chart as a dimension. Your measure will then become:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count(&lt;SPAN&gt;{&amp;lt;DateType = {'Removal Date', 'Start Date'}&amp;gt;} Distinct ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to have different colors for removal Date and Start Date, just create two measures as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;DateType = {'Removal Date'}&amp;gt;} Distinct ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;DateType = {'Start Date'}&amp;gt;} Distinct ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps !&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jérôme&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2020 21:56:44 GMT</pubDate>
    <dc:creator>JeromeS</dc:creator>
    <dc:date>2020-11-11T21:56:44Z</dc:date>
    <item>
      <title>Problem around showing a count of 2 different things through using one date in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-around-showing-a-count-of-2-different-things-through/m-p/1760884#M454031</link>
      <description>&lt;P&gt;Dear Qlik experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if someone could kindly help me with achieving a stacked bar chart which will show the week commencing in which an ID had a start&amp;nbsp; date, but will also show when an ID was removed&lt;/P&gt;&lt;P&gt;Example being that and ID has a start date for WC 10/02/2020 and would therefore be counted in a stacked bar chart under 10/02/2020, but the ID was removed in WC 08/06/2020 and would therefore be counted as 1 in WC 08/06/2020&lt;/P&gt;&lt;P&gt;The problem is I can only show one date in the X axis of the stacked bar chart but the counts are using Start Date and Removal Date....&lt;/P&gt;&lt;P&gt;I have a created an initial table which has all the fundamentals I need....I just need help with the next step I.e. how do I get a start and removal count for one ID to show in the correct weeks?&lt;/P&gt;&lt;P&gt;Any help is appreciated&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;ID,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Start Date,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Removal Date,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Week_By_Date_Start,&amp;nbsp; //This is the Monday which the StartDate falls in&lt;/P&gt;&lt;P&gt;Week_By_Date_End,&amp;nbsp; &amp;nbsp; //This is the following Sunday which the StartDate falls in&lt;/P&gt;&lt;P&gt;Week_By_Date_Removal_Start,&amp;nbsp; //This is the Monday which the Removal Date falls in&lt;/P&gt;&lt;P&gt;Week_By_Date_Removal_End&amp;nbsp; &amp;nbsp; //This is the following Sunday which the RemovalDate falls in&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Count( Distinct (If([Start Date] &amp;gt;= Week_By_Date_Start and [Start Date] &amp;lt;= Week_By_Date_End, [ID]))) as Count_ID_Adds_By_Week, //Counts when the ID has a Start Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count( Distinct (If([Removal Date] &amp;gt;= Week_By_Date_Removal_Start and [Removal Date] &amp;lt;= Week_By_Date_Removal_End, [ID]))) as Count_WL_Removals_By_Week&lt;BR /&gt;//Counts when the ID has a removal Date&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;Table X&lt;BR /&gt;Group By&lt;BR /&gt;ID,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Start Date,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Removal Date,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Week_By_Date_Start,&amp;nbsp;&lt;BR /&gt;Week_By_Date_End,&amp;nbsp; &amp;nbsp;&lt;BR /&gt;Week_By_Date_Removal_Start,&amp;nbsp;&lt;BR /&gt;Week_By_Date_Removal_End&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 21:14:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-around-showing-a-count-of-2-different-things-through/m-p/1760884#M454031</guid>
      <dc:creator>helen_pip</dc:creator>
      <dc:date>2020-11-11T21:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem around showing a count of 2 different things through using one date in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-around-showing-a-count-of-2-different-things-through/m-p/1760904#M454033</link>
      <description>&lt;P&gt;Hi Helen,&lt;/P&gt;&lt;P&gt;One way to achieve what you want would be to build a canonical calendar in your script (see post&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;It would look like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;DateBridge:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Load&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#993300"&gt;ID&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Start Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;&lt;SPAN&gt;CanonicalDate&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'Start Date'&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#993300"&gt;DateType&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Resident Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Concatenate(DateBridge)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#0000FF"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#993300"&gt;ID&lt;/FONT&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Removal Date]&amp;nbsp;&lt;FONT color="#0000FF"&gt;as&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;CanonicalDate&lt;/FONT&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Removal Date'&amp;nbsp;&lt;FONT color="#0000FF"&gt;as&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#993300"&gt;DateType&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Resident Table1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In parallell to DateBridge Table you can also add a Canonical Calendar which will hold all the different useful calculated time fields for Canonical Date (year, week, ... see for example the week function here&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/week.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/week.htm&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Once constructed, you can use the Canonical Date or Week in your stacked bar chart as a dimension. Your measure will then become:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count(&lt;SPAN&gt;{&amp;lt;DateType = {'Removal Date', 'Start Date'}&amp;gt;} Distinct ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to have different colors for removal Date and Start Date, just create two measures as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;DateType = {'Removal Date'}&amp;gt;} Distinct ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;DateType = {'Start Date'}&amp;gt;} Distinct ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps !&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jérôme&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 21:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-around-showing-a-count-of-2-different-things-through/m-p/1760904#M454033</guid>
      <dc:creator>JeromeS</dc:creator>
      <dc:date>2020-11-11T21:56:44Z</dc:date>
    </item>
  </channel>
</rss>

