<?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: Set expression referring to the current dimension - no result in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470689#M99643</link>
    <description>&lt;P&gt;Hello Ruben,&lt;/P&gt;
&lt;P&gt;Thanks, that worked as expected. I should have thought about using Aggr.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2024 12:13:42 GMT</pubDate>
    <dc:creator>JurgenW</dc:creator>
    <dc:date>2024-07-15T12:13:42Z</dc:date>
    <item>
      <title>Set expression referring to the current dimension - no result</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470499#M99629</link>
      <description>&lt;P&gt;I have a table with a list of shops and the week they started working with us (StartWeek)&lt;/P&gt;
&lt;P&gt;I now want to make a chart showing per week how many shops started.&lt;/P&gt;
&lt;P&gt;Because the shops need to be linked to orders and the orders to my calendar, I cannot link this week to the calendar. But I want to use the calendar as a dimension so it responds to the selections the user makes.&lt;/P&gt;
&lt;P&gt;So basically I want to count the number of shops where the 'StartWeek' of the shop equals the 'WeekYear' in the calendar.&lt;/P&gt;
&lt;P&gt;After some research and trial and error I know that this formula calculates the correct 'WeekYear' value for every week in my dimension. In the chart I see a bar for every week with the WeekYear as a value (see also the attached file)&lt;/P&gt;
&lt;P&gt;=Only({1&amp;lt;WeekYear=P(WeekYear)&amp;gt;}WeekYear)&lt;/P&gt;
&lt;P&gt;And I know that the below formula calculates the correct number of shops for example the first week of 2024.&lt;/P&gt;
&lt;P&gt;=Count({&amp;lt;StartWeek={"202401"}&amp;gt;}Distinct ShopId)&lt;/P&gt;
&lt;P&gt;So I expected the this formula to give the correct result for every week but it doesn't. All values are zero.&lt;/P&gt;
&lt;P&gt;=Count({&amp;lt;StartWeek={"=Only({1&amp;lt;WeekYear=P(WeekYear)&amp;gt;}WeekYear)"}&amp;gt;}Distinct ShopId)&lt;/P&gt;
&lt;P&gt;If I replace the 'Only' by a 'Min' or 'Max' it returns all shops for which the StartWeek is filled.&lt;/P&gt;
&lt;P&gt;Can anybody help me to get the correct formula? Or do you see another way to get this result without linking the shops to the calendar?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2024 11:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470499#M99629</guid>
      <dc:creator>JurgenW</dc:creator>
      <dc:date>2024-07-13T11:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression referring to the current dimension - no result</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470521#M99632</link>
      <description>&lt;P&gt;Hi, I think this expression will return the expected values:&lt;/P&gt;
&lt;P&gt;=Aggr(If(StartWeek=WeekYear, Count(distinct ShopId)),StartWeek,WeekYear)&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 08:46:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470521#M99632</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-07-14T08:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression referring to the current dimension - no result</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470541#M99634</link>
      <description>&lt;P&gt;I think you might need to use the Canonical Date design pattern. See this article ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/Canonical-Date/ba-p/1463578" target="_blank"&gt;https://community.qlik.com/t5/Design/Canonical-Date/ba-p/1463578&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cheers, Barnaby.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 21:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470541#M99634</guid>
      <dc:creator>barnabyd</dc:creator>
      <dc:date>2024-07-14T21:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression referring to the current dimension - no result</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470689#M99643</link>
      <description>&lt;P&gt;Hello Ruben,&lt;/P&gt;
&lt;P&gt;Thanks, that worked as expected. I should have thought about using Aggr.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 12:13:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470689#M99643</guid>
      <dc:creator>JurgenW</dc:creator>
      <dc:date>2024-07-15T12:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression referring to the current dimension - no result</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470690#M99644</link>
      <description>&lt;P&gt;Hallo Barnaby&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion. That was indeed a path I was exploring, but Ruben's solution has the advantage of simplicity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 12:14:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-referring-to-the-current-dimension-no-result/m-p/2470690#M99644</guid>
      <dc:creator>JurgenW</dc:creator>
      <dc:date>2024-07-15T12:14:49Z</dc:date>
    </item>
  </channel>
</rss>

