<?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 combine Set expressions with If statements in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32847#M5554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure why the Set and if statement doesn't work for you... I would have expected it to work...., but the second expression should be like this (just a comma separating the two sets instead of &lt;STRONG&gt;&amp;gt;} {&amp;lt;&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;[Store Type2] = {'Concept', 'Estore', 'HQ Ret','SiS','Soft shop'}&lt;SPAN style="color: #ff0000;"&gt;,&lt;/SPAN&gt; [Type Description] = {'men', 'ladies'}&amp;gt;} If(WildMatch(SeasonCalc, vCurrentSeasonCalc), Fsgantal*_YTD_TW_TY))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2018 15:52:46 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-02-15T15:52:46Z</dc:date>
    <item>
      <title>How to combine Set expressions with If statements</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32846#M5553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following code in my expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;Sum ({&amp;lt;[Store Type2] = {'Concept', 'Estore', 'HQ Ret','SiS','Soft shop'}&amp;gt;} If(WildMatch(SeasonCalc, vCurrentSeasonCalc),Fsgantal*_YTD_TW_TY))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above is supposed to return the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;If(WildMatch(SeasonCalc, vCurrentSeasonCalc) &lt;SPAN style="color: #ff0000;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;Should return the season as 181S in this case, it builds on the calculations I have in my script:&lt;/SPAN&gt; &lt;SPAN style="font-family: courier\ new, courier;"&gt;LET vCurrentSeasonCalc = Right(Year(Today()-7), 2) &amp;amp; IF(VECKANRTMP &amp;lt; '27','1','2') &amp;amp; '*';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;{&amp;lt;[Store Type2] = {'Concept', 'Estore', 'HQ Ret','SiS','Soft shop'}&amp;gt;} &lt;SPAN style="color: #ff0000;"&gt;= &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;Is the set expression to only pick the store types I'm interested at this point.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;Fsgantal &lt;SPAN style="color: #ff0000;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: arial, helvetica, sans-serif;"&gt;Amount sold&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;_YTD_TW_TY&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: arial, helvetica, sans-serif;"&gt;Year to date, this week, this year&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;What happens is that the expression does not take both the set expression and the If statement into account, which I need it to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Similarly, I have an issue when there are two (2) set expressions in the same Expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;Sum ({&amp;lt;[Store Type2] = {'Concept', 'Estore', 'HQ Ret','SiS','Soft shop'}&amp;gt;} {&amp;lt;[Type Description] = {'men', 'ladies'}&amp;gt;} If(WildMatch(SeasonCalc, vCurrentSeasonCalc),Fsgantal*_YTD_TW_TY))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;In the above, this is a new string:&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;{&amp;lt;[Type Description] = {'men', 'ladies'}&amp;gt;} = &lt;SPAN style="color: #ff0000; font-family: arial, helvetica, sans-serif;"&gt;Makes sure that only Men and Ladies are taken into account, but can I still tell (by the sum total) that accessories, bags and wallets are still included.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #ff0000; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="color: #000000;"&gt;So I guess the questions boils down to: &lt;STRONG style="text-decoration: underline;"&gt;How do I combine multiple set expressions together, as well as together with an If-statement?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier\ new, courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32846#M5553</guid>
      <dc:creator>robinwiman</dc:creator>
      <dc:date>2018-02-15T15:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine Set expressions with If statements</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32847#M5554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure why the Set and if statement doesn't work for you... I would have expected it to work...., but the second expression should be like this (just a comma separating the two sets instead of &lt;STRONG&gt;&amp;gt;} {&amp;lt;&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;[Store Type2] = {'Concept', 'Estore', 'HQ Ret','SiS','Soft shop'}&lt;SPAN style="color: #ff0000;"&gt;,&lt;/SPAN&gt; [Type Description] = {'men', 'ladies'}&amp;gt;} If(WildMatch(SeasonCalc, vCurrentSeasonCalc), Fsgantal*_YTD_TW_TY))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32847#M5554</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-15T15:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine Set expressions with If statements</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32848#M5555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! the whole expression actually work now &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; It seems that the error in the set expression gave me a wrong expression altogether. Everything works fine now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 07:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-Set-expressions-with-If-statements/m-p/32848#M5555</guid>
      <dc:creator>robinwiman</dc:creator>
      <dc:date>2018-02-16T07:08:02Z</dc:date>
    </item>
  </channel>
</rss>

