<?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: Looping / selecting range in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750193#M1044295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost there thanks tresesco....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to miss the first week, but does get all the rest?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Dec 2014 12:55:07 GMT</pubDate>
    <dc:creator>jag7777777</dc:creator>
    <dc:date>2014-12-01T12:55:07Z</dc:date>
    <item>
      <title>Looping / selecting range in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750189#M1044290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upon start-up, I'm using actions to select various values - such as current year, last year etc.. so I can initialise our dashboard to show a year on year comparison.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list box which contains week numbers - and due to not wanting to include incomplete weeks in our comparison - I'd like to select all weeks up to the previous week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already created a data island in the script to get variables for current weeks, days, years etc... so using 'current week - 1' is fine to get the cut-off point. The tricky part is looping through from (week 1) to (current week - 1) as the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I could use a while loop it would be simple...or some sort of range logic like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= 1 .. ([Current Week] -1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 11:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750189#M1044290</guid>
      <dc:creator>jag7777777</dc:creator>
      <dc:date>2014-12-01T11:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looping / selecting range in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750190#M1044292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post some sample data and the expression that u r using.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 11:29:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750190#M1044292</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2014-12-01T11:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Looping / selecting range in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750191#M1044293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sushil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No sample data needed...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a field called Week that contains numbers (1 to 53) - and there's a variable called Current Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to auto-select Weeks 1 to [Current Week] - 1. Pretty simple I know, but there's no looping syntax in the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 11:32:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750191#M1044293</guid>
      <dc:creator>jag7777777</dc:creator>
      <dc:date>2014-12-01T11:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Looping / selecting range in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750192#M1044294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search string, something like:&lt;/P&gt;&lt;P&gt;='('&amp;amp;Concat(DISTINCT if(Week&amp;lt;$(CurrentWeek),Week), '|')&amp;amp;')'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 11:37:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750192#M1044294</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-12-01T11:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Looping / selecting range in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750193#M1044295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost there thanks tresesco....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to miss the first week, but does get all the rest?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 12:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750193#M1044295</guid>
      <dc:creator>jag7777777</dc:creator>
      <dc:date>2014-12-01T12:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Looping / selecting range in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750194#M1044296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tresesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This did work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We wrote the same code again (from memory whilst on the train to London) in a copy of our UI qvw and it worked perfectly.&lt;/P&gt;&lt;P&gt;When we got back, we checked the code in the original UI qvw and it was the same - yet still didn't return the first week..?&lt;/P&gt;&lt;P&gt;Turns out QlivView was remembering our selection!!! So missing the first week had nothing to do with the syntax!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, a clear all and save - then re-open is something I'll never forget again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers Tresesco for the solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 09:13:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-selecting-range-in-expression/m-p/750194#M1044296</guid>
      <dc:creator>jag7777777</dc:creator>
      <dc:date>2014-12-05T09:13:18Z</dc:date>
    </item>
  </channel>
</rss>

