<?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: Condition based on Drill Down level in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Condition-based-on-Drill-Down-level-in-Qlik-Sense/m-p/878910#M12187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Soo....&lt;/P&gt;&lt;P&gt;Seams like I found solution using Pick() and Match() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick(&lt;/P&gt;&lt;P&gt;Match(&lt;/P&gt;&lt;P&gt;IF(Interval(Max(total Date)-Min(total Date), 'D')&amp;lt;8,'Days',&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(Interval(Max(total Date)-Min(total Date), 'D')&amp;gt;7,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF(Interval(Max(total Date)-Min(total Date), 'D')&amp;lt;30,'Weeks','Months')))&lt;/P&gt;&lt;P&gt;,'Days','Weeks','Months'&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;),&lt;/P&gt;&lt;P&gt;sum(IF(DayName(Date) = DayName(Max(total Date)),Sales)),&lt;/P&gt;&lt;P&gt;sum(IF(WeekName(Date) = WeekName(Max(total Date)),Sales)),&lt;/P&gt;&lt;P&gt;sum(IF(MonthName(Date) = MonthName(Max(total Date)),Sales))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still not sure about number of days in Interval() condition, but I will focus on this later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps someone &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Miroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Jun 2015 14:40:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-06-01T14:40:38Z</dc:date>
    <item>
      <title>Condition based on Drill Down level in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Condition-based-on-Drill-Down-level-in-Qlik-Sense/m-p/878909#M12186</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 would need some help with following logic:&lt;/P&gt;&lt;P&gt;I have a drill down date dimension (year/month/week/day) and I want to compare values (for example sum of sold products) at the begining and end of some period. The issue is, that I want to compare sum(sold_products) in min month and max month, THEN, when I choose only one month, I drill down to weeks and here aI want to compare sum(sold_products) in min week and max week.&lt;/P&gt;&lt;P&gt;Lowest level in Date dimension is Time, so I've tried to use Interval() to find out, where in Drill Down dimension I'm right now:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;minDD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;lt; 24, DayName(Min(total Date)), &lt;/P&gt;&lt;P&gt; if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;gt; 24, if(Interval(Max(total Date)-Min(total Date), 'hh')&lt;/P&gt;&lt;P&gt; &amp;lt; 168, WeekName(Min(total Date)), MonthName(Min(total Date)))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;maxDD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;lt; 24, DayName(Max(total Date)), &lt;/P&gt;&lt;P&gt; if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;gt; 24, if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;lt; 50, WeekName(Max(total Date)), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthName(Max(total Date)))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/87914_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;When I choose one month, so I drill down to weeks, minDD and maxDD show weeks:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/87915_pastedImage_6.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to use this logic in KPIs.&lt;/P&gt;&lt;P&gt;I want to compare last and first Month/Week/Day.&lt;/P&gt;&lt;P&gt;For example this works for Days:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( &lt;/P&gt;&lt;P&gt;if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;lt; 24,&lt;/P&gt;&lt;P&gt; IF(DayName(Date) = DayName(Min(total Date))&lt;/P&gt;&lt;P&gt;,Sales)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I cannot figure out, how to implement the rest. For example when I tried to add Weeks, expression dosn't work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM( &lt;BR /&gt;if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;lt; 24,&lt;BR /&gt; IF(DayName(Date) = DayName(Min(total Date)), &lt;/P&gt;&lt;P&gt;if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;gt; 24, &lt;BR /&gt; if(Interval(Max(total Date)-Min(total Date), 'hh') &amp;lt; 168, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(WeekName(Date) = WeekName(Min(total Date))&lt;/P&gt;&lt;P&gt;,Sales))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me please?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mirek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 12:54:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Condition-based-on-Drill-Down-level-in-Qlik-Sense/m-p/878909#M12186</guid>
      <dc:creator />
      <dc:date>2015-05-29T12:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Condition based on Drill Down level in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Condition-based-on-Drill-Down-level-in-Qlik-Sense/m-p/878910#M12187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Soo....&lt;/P&gt;&lt;P&gt;Seams like I found solution using Pick() and Match() function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick(&lt;/P&gt;&lt;P&gt;Match(&lt;/P&gt;&lt;P&gt;IF(Interval(Max(total Date)-Min(total Date), 'D')&amp;lt;8,'Days',&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(Interval(Max(total Date)-Min(total Date), 'D')&amp;gt;7,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF(Interval(Max(total Date)-Min(total Date), 'D')&amp;lt;30,'Weeks','Months')))&lt;/P&gt;&lt;P&gt;,'Days','Weeks','Months'&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;),&lt;/P&gt;&lt;P&gt;sum(IF(DayName(Date) = DayName(Max(total Date)),Sales)),&lt;/P&gt;&lt;P&gt;sum(IF(WeekName(Date) = WeekName(Max(total Date)),Sales)),&lt;/P&gt;&lt;P&gt;sum(IF(MonthName(Date) = MonthName(Max(total Date)),Sales))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still not sure about number of days in Interval() condition, but I will focus on this later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps someone &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Miroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 14:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Condition-based-on-Drill-Down-level-in-Qlik-Sense/m-p/878910#M12187</guid>
      <dc:creator />
      <dc:date>2015-06-01T14:40:38Z</dc:date>
    </item>
  </channel>
</rss>

