<?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 Problem with multiple If-Clause in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297856#M110476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to integrate an If-Clause, which groups my days (1 till 31) into 2.&lt;/P&gt;&lt;P&gt;The reason is that there are transactions two times a month. Therefore it should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Day 1-4 and Day 20-31 = Transaction on Day 5&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Day 5-19= Transaction on Day 20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I don't want to group them by typing each number manually, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Day=1, '5',&lt;/P&gt;&lt;P&gt;If(Day=2, '5',&lt;/P&gt;&lt;P&gt;If(Day=3, '5'...))) as GroupedDays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause it's simply to long-winded!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea was this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Day&amp;gt;=5, If(Day&amp;lt;20, '20',&lt;/P&gt;&lt;P&gt;If(Day&amp;gt;=20,If(Day&amp;lt;5,'5',))))as TestDay &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Synthax check is OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I'm having here's that my new column just includes 20, not 5.&amp;nbsp; Although the link towards 'day' is particulary&amp;nbsp; working.&lt;/P&gt;&lt;P&gt;Means:&lt;/P&gt;&lt;P&gt;When I select 20 in 'TestDay' I get 5-19, which is correct.&lt;/P&gt;&lt;P&gt;But where's my 5 in 'TestDay', any clue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jun 2011 09:31:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-17T09:31:23Z</dc:date>
    <item>
      <title>Problem with multiple If-Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297856#M110476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to integrate an If-Clause, which groups my days (1 till 31) into 2.&lt;/P&gt;&lt;P&gt;The reason is that there are transactions two times a month. Therefore it should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Day 1-4 and Day 20-31 = Transaction on Day 5&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Day 5-19= Transaction on Day 20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I don't want to group them by typing each number manually, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Day=1, '5',&lt;/P&gt;&lt;P&gt;If(Day=2, '5',&lt;/P&gt;&lt;P&gt;If(Day=3, '5'...))) as GroupedDays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause it's simply to long-winded!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea was this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Day&amp;gt;=5, If(Day&amp;lt;20, '20',&lt;/P&gt;&lt;P&gt;If(Day&amp;gt;=20,If(Day&amp;lt;5,'5',))))as TestDay &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Synthax check is OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I'm having here's that my new column just includes 20, not 5.&amp;nbsp; Although the link towards 'day' is particulary&amp;nbsp; working.&lt;/P&gt;&lt;P&gt;Means:&lt;/P&gt;&lt;P&gt;When I select 20 in 'TestDay' I get 5-19, which is correct.&lt;/P&gt;&lt;P&gt;But where's my 5 in 'TestDay', any clue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2011 09:31:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297856#M110476</guid>
      <dc:creator />
      <dc:date>2011-06-17T09:31:23Z</dc:date>
    </item>
    <item>
      <title>Problem with multiple If-Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297857#M110477</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;load a mapping table and use applymap. Look in help and on forum for examples. (might be long-winded but you will learn for the future and save yourself time!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to write out 15 of the days followed by a comma followed by 20. But xl has many useful functionalities to help you do this like copy/paste. the other 16 days just let the default parameter in the applymap() function do that for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get you on your way here is a link to Steve Dark's blog with a post about applymap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/"&gt;http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2011 10:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297857#M110477</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-17T10:01:49Z</dc:date>
    </item>
    <item>
      <title>Problem with multiple If-Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297858#M110478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you should go for the applymap as mentioned in the other post or use intervalmatch.&lt;/P&gt;&lt;P&gt;If you want to keep the if-statement, you can make it simple: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Day&amp;gt;=5 and Day&amp;lt;=19, 20, 5)&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;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2011 10:28:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297858#M110478</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-06-17T10:28:46Z</dc:date>
    </item>
    <item>
      <title>Problem with multiple If-Clause</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297859#M110479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2011 10:45:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-If-Clause/m-p/297859#M110479</guid>
      <dc:creator />
      <dc:date>2011-06-17T10:45:39Z</dc:date>
    </item>
  </channel>
</rss>

