<?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 to correctly use Mid function in set expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70307#M11592</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are looking to evaluate the condition on row by row basis, set analysis in not going to work for you.... You will either need to create a flag in the script or use an if statement to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT If(Period = Mid(PeriodWeek,6,3), Week))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198742_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Apr 2018 13:12:31 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-04-06T13:12:31Z</dc:date>
    <item>
      <title>How to correctly use Mid function in set expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70306#M11591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where i need to extract the month/period part from a key containing year-month-week.&lt;/P&gt;&lt;P&gt;This needs to be done in a chart which has to show all records irrespective of any period/week selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached file, i am using the following expression to count the number of weeks in the corresponding period in chart:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; count({&amp;lt;Period={"=mid(PeriodWeek,6,3)"}&amp;gt;}distinct Week), &lt;SPAN style="font-size: 10pt;"&gt;however it is always returning 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please suggest the correct usage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:09:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70306#M11591</guid>
      <dc:creator>reema_dangwal</dc:creator>
      <dc:date>2018-04-06T13:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to correctly use Mid function in set expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70307#M11592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you are looking to evaluate the condition on row by row basis, set analysis in not going to work for you.... You will either need to create a flag in the script or use an if statement to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT If(Period = Mid(PeriodWeek,6,3), Week))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198742_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70307#M11592</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-06T13:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to correctly use Mid function in set expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70308#M11593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, however I need to display count of weeks as total number of weeks in that period, for eg. all rows with&amp;nbsp; P01 should display 4 and P03 should display 5.&lt;/P&gt;&lt;P&gt;I tried disregarding the dimension with the following, it is not working:&lt;/P&gt;&lt;P&gt; Count({&amp;lt;Week=,Period=,PeriodWeek=&amp;gt;}DISTINCT If(Period = Mid(PeriodWeek,6,3), Week))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2018 10:39:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70308#M11593</guid>
      <dc:creator>reema_dangwal</dc:creator>
      <dc:date>2018-04-09T10:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to correctly use Mid function in set expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70309#M11594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198969_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(Count(TOTAL &amp;lt;Period&amp;gt;DISTINCT If(Period = Mid(PeriodWeek,6,3), Week)), PeriodWeek, Period)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2018 16:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-correctly-use-Mid-function-in-set-expression/m-p/70309#M11594</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-09T16:31:34Z</dc:date>
    </item>
  </channel>
</rss>

