<?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 Distinct HELP!!! in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458362#M35966</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Think it's easier to look at if I only focus en the second part of the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;=(Count(DISTINCT{$&amp;lt;[Year]-={'2006'}&amp;gt;}[Year-Month]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I have 11 years info, so no filters that is equal to 132, but if I select 2017 that should be equal to 12, but It's still 132&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2018 00:12:58 GMT</pubDate>
    <dc:creator>macuevah</dc:creator>
    <dc:date>2018-01-04T00:12:58Z</dc:date>
    <item>
      <title>Count Distinct HELP!!!</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458360#M35964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use the following expression to express the sales avg considering the number of months. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum Sales in last 11 years = 654,229,440&lt;/P&gt;&lt;P&gt;Months for the period of time selected = ex: 11 years = 132 months (I have an expresión called Year-Month for every sales month "2017-01-Jan","2017-02-Feb" etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression is: =Sum(Subt)/(Count(DISTINCT{$&amp;lt;[Year]-={'2006'}&amp;gt;}[Year-Month]))&lt;/P&gt;&lt;P&gt;If there's no selection the expression works &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;654,229,440 / &lt;STRONG&gt;132&lt;/STRONG&gt; = average sales per month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I select one specific year or more it still divides sales by 132 months, considering that if I select 1 year the formula should be: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;654,229,440 / &lt;STRONG&gt;12&lt;/STRONG&gt; = average sales per month&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;Or if I select 2 years:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;654,229,440 / &lt;STRONG&gt;24&lt;/STRONG&gt; = average sales per month&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;And so on, what am I doing wrong?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jan 2018 23:15:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458360#M35964</guid>
      <dc:creator>macuevah</dc:creator>
      <dc:date>2018-01-03T23:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count Distinct HELP!!!</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458361#M35965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure the denominator is not changing? I think it seems that you don't want the numerator to change with selection? May be 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;=Sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{$&amp;lt;[Year]&amp;gt;} &lt;/SPAN&gt;Subt)/(Count(DISTINCT{$&amp;lt;[Year]-={'2006'}&amp;gt;} [Year-Month]))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 00:08:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458361#M35965</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-01-04T00:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count Distinct HELP!!!</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458362#M35966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Think it's easier to look at if I only focus en the second part of the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;=(Count(DISTINCT{$&amp;lt;[Year]-={'2006'}&amp;gt;}[Year-Month]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I have 11 years info, so no filters that is equal to 132, but if I select 2017 that should be equal to 12, but It's still 132&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 00:12:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458362#M35966</guid>
      <dc:creator>macuevah</dc:creator>
      <dc:date>2018-01-04T00:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count Distinct HELP!!!</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458363#M35967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless your data model is not well connected, I don't see why Count of YearMonth field won't drill down on selection of Year... would you be able to share a sample where you can show the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 00:41:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458363#M35967</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-01-04T00:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Count Distinct HELP!!!</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458364#M35968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does it change when you not use single quotes in '2006' and just 2006. The expression should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only possible explanation i can think of which may forced you to think its not working is if all the months have same number of sales and the average will always be same. and you are assuming that the numerator will not change so that may be the case. but that is highly unlikely&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 04:23:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458364#M35968</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2018-01-04T04:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count Distinct HELP!!!</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458365#M35969</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;If i understand your need correctly, you can use aggr for 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;Avg(Aggr(Sum(Subt),[Year-Month]))&lt;/SPAN&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;&lt;BR /&gt;&lt;/SPAN&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;This will show you the average monthly sales based on your selections.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 04:57:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Distinct-HELP/m-p/1458365#M35969</guid>
      <dc:creator>kaanerisen</dc:creator>
      <dc:date>2018-01-04T04:57:59Z</dc:date>
    </item>
  </channel>
</rss>

