<?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: If Statement with Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60126#M785276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please close the thread by marking any helpful and a correct answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2018 10:31:12 GMT</pubDate>
    <dc:creator>sasiparupudi1</dc:creator>
    <dc:date>2018-03-09T10:31:12Z</dc:date>
    <item>
      <title>If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60119#M785269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a formula where my denominator needs to be the number of days in the week, UNLESS it is the current week and then it needs to be number of days less 1 (so that it does not count the current day).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems pretty straight forward... but can't get it going.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I could use the {1} in the set expression and say "If the max week number (ignoring selection) = the selected week number, count the days less 1, if not, count the days."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(({&amp;lt;[WeekEndWk#]={"1(=Max(WeekEndWk#))"}&amp;gt;}&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;{&amp;lt;[WeekEndWk#]={"$(=Max(WeekEndWk#))"}&amp;gt;})&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;(Count(Distinct(Date)))-1&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;(Count(Distinct(Date))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on correcting syntax or an easier way? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60119#M785269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60120#M785270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please share your data or app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2018 19:09:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60120#M785270</guid>
      <dc:creator>isingh30</dc:creator>
      <dc:date>2018-03-06T19:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60121#M785271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steph, maybe with:&lt;/P&gt;&lt;P&gt;If([WeekEndWk#]=Max({1} [WeekEndWk#])&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;(Count(Distinct(Date)))-1&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;(Count(Distinct(Date))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2018 19:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60121#M785271</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2018-03-06T19:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60122#M785272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah so close! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is on the right track, still giving me zeroes, but better than just null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is a screenshot with some sample info - for week 9 (not the current week) I would want the formula to pick up on 7 days worth of sales. But in the current week (even though there's been 3 days since today is Tuesday) I only want it to count the two days that have sales, whereas the current day count is 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Budget by Day - QS.PNG" class="jive-image image-1" src="/legacyfs/online/195512_Budget by Day - QS.PNG" style="height: 267px; width: 620px;" /&gt;&lt;IMG alt="Budget by Day - Current Week.PNG" class="jive-image image-2" src="/legacyfs/online/195513_Budget by Day - Current Week.PNG" style="height: 143px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2018 22:17:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60122#M785272</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-06T22:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60123#M785273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this, What exactly you are counting? No of days for each SiteID/Week#? &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;If([WeekEndWk#]=Max({1} [WeekEndWk#])&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Aggr(Count(Distinct(Date)))-1,SiteID,&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[WeekEndWk#])&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Aggr((Count(Distinct(Date))))&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;,SiteID,&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[WeekEndWk#])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2018 23:16:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60123#M785273</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2018-03-06T23:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60124#M785274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Thereare many possibilities on what if failing, maybe the easiest way is to load a flag in calendar table (or where date field is):&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD date&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Floor(date)=today(), 1, 0) as isToday&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;...&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;and use:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Count(Distinct {&amp;lt;isToday={0}&amp;gt;} Date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&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 style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Edit: forgot to add that similar flags can be added to get max week or other needs.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2018 09:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60124#M785274</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2018-03-07T09:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60125#M785275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got a formula that accomplishes what I was looking for. May not be the prettiest per se... but it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If([WeekEndWk#]=Week(Today()),&lt;/P&gt;&lt;P&gt;((Num(Today()) - Num(Date(WeekStartDate)))),&lt;/P&gt;&lt;P&gt;((Num(Date(WeekEndDate))) - (Num(Date(WeekStartDate))))+1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2018 20:16:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60125#M785275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-07T20:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60126#M785276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please close the thread by marking any helpful and a correct answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 10:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-Set-Analysis/m-p/60126#M785276</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2018-03-09T10:31:12Z</dc:date>
    </item>
  </channel>
</rss>

