<?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: Week range mapping in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084461#M88901</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you could just calculate the Quarter from the Week number itself, e.g. like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;'Q'&amp;amp;(Div(Week-1,13)+1) as Quarter&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If you really want to use this Week/Quarter table instead, some possible solutions could be (just for scripting reference):&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Expanding the Week ranges and using ApplyMap:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;mapWeeksQuarter:
Mapping
LOAD Week1+IterNo()-1,
     Quarter 
Inline [
Week1,Week2,Quarter
1,13,Q1
14,26,Q2
27,39,Q3
40,52,Q4
]
While Week1+IterNo()-1 &amp;lt;= Week2;


tabOther:
LOAD RecNo() as Week,
     ApplyMap('mapWeeksQuarter',RecNo()) as Quarter,
     Ceil(Rand()*100) as SomeRandomFact
AutoGenerate 52;​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Expanding the Week ranges and joining:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;tabOther:
LOAD RecNo() as Week,
     Ceil(Rand()*100) as SomeRandomFact
AutoGenerate 52;

Left Join
LOAD Week1+IterNo()-1 as Week,
     Quarter 
Inline [
Week1,Week2,Quarter
1,13,Q1
14,26,Q2
27,39,Q3
40,52,Q4
]
While Week1+IterNo()-1 &amp;lt;= Week2;​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;interval matching the weeks to week ranges:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;tabOther:
LOAD RecNo() as Week,
     Ceil(Rand()*100) as SomeRandomFact
AutoGenerate 52;

tabWeeksQuarter:
LOAD * Inline [
Week1,Week2,Quarter
1,13,Q1
14,26,Q2
27,39,Q3
40,52,Q4
];

Left Join (tabOther)
IntervalMatch (Week)
LOAD Week1,
     Week2
Resident tabWeeksQuarter;

Left Join (tabOther)
LOAD * Resident tabWeeksQuarter;

DROP Fields Week1, Week2;
DROP Table tabWeeksQuarter;​&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;hope this helps&lt;BR /&gt;&lt;BR /&gt;Marco&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 15 Jun 2023 20:32:23 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2023-06-15T20:32:23Z</dc:date>
    <item>
      <title>Week range mapping</title>
      <link>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084128#M88854</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;I have a requirement where i will get the data from one table like below&lt;/P&gt;
&lt;P&gt;Load * inline [&lt;/P&gt;
&lt;P&gt;Week1,week2,Quarter&lt;/P&gt;
&lt;P&gt;1,13,Q1&lt;/P&gt;
&lt;P&gt;14,26,Q2&lt;/P&gt;
&lt;P&gt;27,39,Q3&lt;/P&gt;
&lt;P&gt;40,52,Q4&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now i want to map this another table which is having week as column with values 1 to 52,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If i select week 2 it should show category as Q1 respectively, how can i acheive that&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 06:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084128#M88854</guid>
      <dc:creator>GOKULAKANNAN</dc:creator>
      <dc:date>2023-06-15T06:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Week range mapping</title>
      <link>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084205#M88858</link>
      <description>&lt;P&gt;try intervalMtach , which may solve you problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 09:51:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084205#M88858</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2023-06-15T09:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Week range mapping</title>
      <link>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084356#M88887</link>
      <description>&lt;P&gt;I dont have&amp;nbsp; any key field, in table 1 im having week and emp name, in table 2 am having, week1,2 and quarter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 14:06:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084356#M88887</guid>
      <dc:creator>GOKULAKANNAN</dc:creator>
      <dc:date>2023-06-15T14:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Week range mapping</title>
      <link>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084461#M88901</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you could just calculate the Quarter from the Week number itself, e.g. like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;'Q'&amp;amp;(Div(Week-1,13)+1) as Quarter&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If you really want to use this Week/Quarter table instead, some possible solutions could be (just for scripting reference):&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Expanding the Week ranges and using ApplyMap:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;mapWeeksQuarter:
Mapping
LOAD Week1+IterNo()-1,
     Quarter 
Inline [
Week1,Week2,Quarter
1,13,Q1
14,26,Q2
27,39,Q3
40,52,Q4
]
While Week1+IterNo()-1 &amp;lt;= Week2;


tabOther:
LOAD RecNo() as Week,
     ApplyMap('mapWeeksQuarter',RecNo()) as Quarter,
     Ceil(Rand()*100) as SomeRandomFact
AutoGenerate 52;​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Expanding the Week ranges and joining:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;tabOther:
LOAD RecNo() as Week,
     Ceil(Rand()*100) as SomeRandomFact
AutoGenerate 52;

Left Join
LOAD Week1+IterNo()-1 as Week,
     Quarter 
Inline [
Week1,Week2,Quarter
1,13,Q1
14,26,Q2
27,39,Q3
40,52,Q4
]
While Week1+IterNo()-1 &amp;lt;= Week2;​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;interval matching the weeks to week ranges:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;tabOther:
LOAD RecNo() as Week,
     Ceil(Rand()*100) as SomeRandomFact
AutoGenerate 52;

tabWeeksQuarter:
LOAD * Inline [
Week1,Week2,Quarter
1,13,Q1
14,26,Q2
27,39,Q3
40,52,Q4
];

Left Join (tabOther)
IntervalMatch (Week)
LOAD Week1,
     Week2
Resident tabWeeksQuarter;

Left Join (tabOther)
LOAD * Resident tabWeeksQuarter;

DROP Fields Week1, Week2;
DROP Table tabWeeksQuarter;​&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;hope this helps&lt;BR /&gt;&lt;BR /&gt;Marco&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 15 Jun 2023 20:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Week-range-mapping/m-p/2084461#M88901</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2023-06-15T20:32:23Z</dc:date>
    </item>
  </channel>
</rss>

