<?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 Create histogram using filtering and based on distinct values from other column in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Create-histogram-using-filtering-and-based-on-distinct-values/m-p/1882676#M72666</link>
    <description>&lt;P&gt;Say I have a table looking like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;id  age  date
--+----+-----
1   20   2021-01-01
1   20   2021-02-01
2   30   2021-01-01
3   22   2021-03-15
3   22   2021-04-16&lt;/LI-CODE&gt;
&lt;P&gt;I then want to make a histogram of the "age" for distinct "id" which have a "date" less than,say, "2021-02-01".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried :&lt;/P&gt;
&lt;P&gt;("dates" is date-varibale from another table that the user uses to set the upper-bound of the date)&lt;/P&gt;
&lt;P&gt;=AGGR(IF(date&amp;lt;dates,age),id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I just get the error in the chart:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jakobjensen_0-1642585038926.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/70500i2FB115CE8C4BDC18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jakobjensen_0-1642585038926.png" alt="jakobjensen_0-1642585038926.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have also tried set-analysis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=AGGR({$&amp;lt;date={"&amp;lt;$(=Max(dates))"}&amp;gt;} age,id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but that gives the same error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 09:38:47 GMT</pubDate>
    <dc:creator>jakobjensen</dc:creator>
    <dc:date>2022-01-19T09:38:47Z</dc:date>
    <item>
      <title>Create histogram using filtering and based on distinct values from other column</title>
      <link>https://community.qlik.com/t5/App-Development/Create-histogram-using-filtering-and-based-on-distinct-values/m-p/1882676#M72666</link>
      <description>&lt;P&gt;Say I have a table looking like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;id  age  date
--+----+-----
1   20   2021-01-01
1   20   2021-02-01
2   30   2021-01-01
3   22   2021-03-15
3   22   2021-04-16&lt;/LI-CODE&gt;
&lt;P&gt;I then want to make a histogram of the "age" for distinct "id" which have a "date" less than,say, "2021-02-01".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried :&lt;/P&gt;
&lt;P&gt;("dates" is date-varibale from another table that the user uses to set the upper-bound of the date)&lt;/P&gt;
&lt;P&gt;=AGGR(IF(date&amp;lt;dates,age),id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I just get the error in the chart:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jakobjensen_0-1642585038926.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/70500i2FB115CE8C4BDC18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jakobjensen_0-1642585038926.png" alt="jakobjensen_0-1642585038926.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have also tried set-analysis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=AGGR({$&amp;lt;date={"&amp;lt;$(=Max(dates))"}&amp;gt;} age,id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but that gives the same error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 09:38:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-histogram-using-filtering-and-based-on-distinct-values/m-p/1882676#M72666</guid>
      <dc:creator>jakobjensen</dc:creator>
      <dc:date>2022-01-19T09:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create histogram using filtering and based on distinct values from other column</title>
      <link>https://community.qlik.com/t5/App-Development/Create-histogram-using-filtering-and-based-on-distinct-values/m-p/1886539#M73034</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Find example :&lt;/P&gt;
&lt;P&gt;//Add dummy people data&lt;BR /&gt;PeopleTemp:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;PersonID, Person&lt;BR /&gt;1, Jane&lt;BR /&gt;2, Joe&lt;BR /&gt;3, Shawn&lt;BR /&gt;4, Sue&lt;BR /&gt;5, Frank&lt;BR /&gt;6, Mike&lt;BR /&gt;7, Gloria&lt;BR /&gt;8, Mary&lt;BR /&gt;9, Steven,&lt;BR /&gt;10, Bill&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;//Add dummy age data&lt;BR /&gt;AgeTemp:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;PersonID, Age&lt;BR /&gt;1, 23&lt;BR /&gt;2, 45&lt;BR /&gt;3, 43&lt;BR /&gt;4, 30&lt;BR /&gt;5, 40&lt;BR /&gt;6, 32&lt;BR /&gt;7, 45&lt;BR /&gt;8, 54&lt;BR /&gt;9,&lt;BR /&gt;10, 61&lt;BR /&gt;11, 21&lt;BR /&gt;12, 39&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;//LOAD new table with people&lt;BR /&gt;People:&lt;BR /&gt;NoConcatenate LOAD&lt;BR /&gt;PersonID,&lt;BR /&gt;Person&lt;BR /&gt;Resident PeopleTemp;&lt;BR /&gt;&lt;BR /&gt;Drop Table PeopleTemp;&lt;BR /&gt;&lt;BR /&gt;//Add age and age bucket fields to the People table&lt;BR /&gt;Left Join (People)&lt;BR /&gt;LOAD&lt;BR /&gt;PersonID,&lt;BR /&gt;Age,&lt;BR /&gt;If(IsNull(Age) or Age='', Dual('No age', 5),&lt;BR /&gt;If(Age&amp;lt;25, Dual('Under 25', 1),&lt;BR /&gt;If(Age&amp;gt;=25 and Age &amp;lt;35, Dual('25-34', 2),&lt;BR /&gt;If(Age&amp;gt;=35 and Age&amp;lt;50, Dual('35-49' , 3),&lt;BR /&gt;If(Age&amp;gt;=50, Dual('50 or over', 4)&lt;BR /&gt;))))) as AgeBucket&lt;BR /&gt;Resident AgeTemp&lt;BR /&gt;Where Exists(PersonID);&lt;BR /&gt;&lt;BR /&gt;DROP Table AgeTemp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take : Agbucket in dimension&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vikasmahajan_0-1643377625755.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/71174iDF3DDFD252E598D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vikasmahajan_0-1643377625755.png" alt="vikasmahajan_0-1643377625755.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way you can create histogram chart.&lt;/P&gt;
&lt;P&gt;Hope this will help you&lt;/P&gt;
&lt;P&gt;Vikas&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 13:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Create-histogram-using-filtering-and-based-on-distinct-values/m-p/1886539#M73034</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2022-01-28T13:47:33Z</dc:date>
    </item>
  </channel>
</rss>

