<?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: How can I get Mode of a dimension? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901370#M74363</link>
    <description>&lt;P&gt;I agree that Qlik works fine. But I have a valid question and hope to resolve it.&lt;/P&gt;
&lt;P&gt;So, my question is how Qlik expression can help me to find an answer to this question? (maybe using something like nested aggregation)&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 16:48:49 GMT</pubDate>
    <dc:creator>parviz_asoodehfard</dc:creator>
    <dc:date>2022-03-04T16:48:49Z</dc:date>
    <item>
      <title>How can I get Mode of a dimension?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901268#M74359</link>
      <description>&lt;P&gt;Getting the Mode of the dimension key is easy but how we can get the mode of a dimension?&lt;/P&gt;
&lt;P&gt;To make answering easier, I put an example of data here&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="parviz_asoodehfard_0-1646404116456.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73658i3E6ADC277B9B3A68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="parviz_asoodehfard_0-1646404116456.png" alt="parviz_asoodehfard_0-1646404116456.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="parviz_asoodehfard_1-1646404129589.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73660iC0A0CDABC37AB8C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="parviz_asoodehfard_1-1646404129589.png" alt="parviz_asoodehfard_1-1646404129589.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="parviz_asoodehfard_2-1646404142885.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73662i4629ABA55C89A395/image-size/medium?v=v2&amp;amp;px=400" role="button" title="parviz_asoodehfard_2-1646404142885.png" alt="parviz_asoodehfard_2-1646404142885.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The Mode(customer_id) works fine. However, Here I'm looking for the Mode of customer_name based on the fact table but it doesn't work by mode(customer_name) as you can see. So I'm looking for a formula that generates the "My expectation" column.&lt;/P&gt;
&lt;P&gt;what would be an expression for the "My expectation" column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--------------------------------------&lt;/P&gt;
&lt;P&gt;fact_purchase:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;fact_id,customer_id, purchased_item&lt;BR /&gt;1,1,1&lt;BR /&gt;2,2,1&lt;BR /&gt;3,3,1&lt;BR /&gt;4,3,1&lt;BR /&gt;5,1,2&lt;BR /&gt;6,2,2&lt;BR /&gt;7,2,2&lt;BR /&gt;8,1,3&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;dim_customer:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;customer_id, customer_name&lt;BR /&gt;1,Jon&lt;BR /&gt;2,Michael&lt;BR /&gt;3,June&lt;BR /&gt;];&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 14:51:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901268#M74359</guid>
      <dc:creator>parviz_asoodehfard</dc:creator>
      <dc:date>2022-03-04T14:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Mode of a dimension?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901336#M74362</link>
      <description>&lt;P&gt;No, the Qlik engine is doing the right thing.&lt;/P&gt;&lt;P&gt;First of all, your dimension is "purchased item", and since "customer_id" exists in the same table as&amp;nbsp;"purchased item", this is where the Mode("customer_id") will be evaluated:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Henric_Cronstrm_0-1646407931236.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73691i3FB3D34763CB8954/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Henric_Cronstrm_0-1646407931236.png" alt="Henric_Cronstrm_0-1646407931236.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that Mode() corresponds perfectly to the multiplicities shown by Concat().&lt;/P&gt;&lt;P&gt;However, with&amp;nbsp;"customer_name" it is a different thing: It is in the "dim_customer" table, so now the evaluation of Mode() is made there:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Henric_Cronstrm_1-1646408065250.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/73692iE92089F8D6C772F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Henric_Cronstrm_1-1646408065250.png" alt="Henric_Cronstrm_1-1646408065250.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that all three names exists exactly once, so for "purchased_item" = 1 or two, it is not possible to say which of the names is more common.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 15:39:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901336#M74362</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-03-04T15:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Mode of a dimension?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901370#M74363</link>
      <description>&lt;P&gt;I agree that Qlik works fine. But I have a valid question and hope to resolve it.&lt;/P&gt;
&lt;P&gt;So, my question is how Qlik expression can help me to find an answer to this question? (maybe using something like nested aggregation)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 16:48:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901370#M74363</guid>
      <dc:creator>parviz_asoodehfard</dc:creator>
      <dc:date>2022-03-04T16:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Mode of a dimension?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901388#M74366</link>
      <description>&lt;P&gt;Mode(Aggr(Only(customer_name),fact_id))&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 17:26:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901388#M74366</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-03-04T17:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Mode of a dimension?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901406#M74367</link>
      <description>&lt;P&gt;Great.&lt;/P&gt;
&lt;P&gt;I brought fact_id to make it easier talking about rows. My table doesn't have fact_id. Is there any solution without fact_id?&lt;/P&gt;
&lt;P&gt;By the way Thanks, Sir. I've just learned "Only" function.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 18:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901406#M74367</guid>
      <dc:creator>parviz_asoodehfard</dc:creator>
      <dc:date>2022-03-04T18:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get Mode of a dimension?</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901409#M74368</link>
      <description>&lt;P&gt;You need some field to define what you mean by a "row". fact_id is perfect for this.&lt;/P&gt;&lt;P&gt;Add&amp;nbsp;&lt;/P&gt;&lt;P&gt;RecNo() as fact_id&lt;/P&gt;&lt;P&gt;to your fact table in the script.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 18:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-get-Mode-of-a-dimension/m-p/1901409#M74368</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-03-04T18:38:55Z</dc:date>
    </item>
  </channel>
</rss>

