<?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 If Else statement into Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174512#M43308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe do the same for the others and add them together? I also recommend single quotes instead of double quotes for literals. Double quotes specify a search string, which while it returns the exact same results, might take a different and slightly less efficient path through the system. So single quotes for literals, double quotes for search strings.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum({&amp;lt;[Last Name]={'ABC'},[Project Code Type]={'Admin'} &amp;gt;} [ABC admin target])&lt;BR /&gt;+sum({&amp;lt;[Last Name]={'ABC'},[Project Code Type]={'Client'} &amp;gt;} [ABC client target])&lt;BR /&gt;+sum({&amp;lt;[Last Name]={'ABC'},[Project Code Type]={'Internal'}&amp;gt;} [ABC internal target])&lt;/P&gt;&lt;P&gt;However, if those are the ONLY three project code types, this might be just as efficient, possibly even better (on the down side, to me, the above is more clear):&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum({&amp;lt;[Last Name]={'ABC'}&amp;gt;}&lt;BR /&gt; pick(match([Project Code Type],'Admin','Client','Internal')&lt;BR /&gt; ,[ABC admin target],[ABC client target],[ABC internal target]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Nov 2010 20:22:44 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2010-11-05T20:22:44Z</dc:date>
    <item>
      <title>If Else statement into Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174511#M43307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;Hello,&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;How can I rewrite the following If Else statement using Set Analysis?&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;I am trying to display the variables [ABC admin target], [ABC client target], and [ABC internal target] (user entered input in an Input Box) next to the according employee/project category in a straight table.&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;I got the first part to work by doing:&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;sum({$&amp;lt;[Last Name] ={"ABC"}, [Project Code Type]={"Admin"}&amp;gt;} [ABC admin target] )&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;but I am not sure how I can write the Else statement using Set Analysis.&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;Here's the If Else Statement:&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;if([Last Name]='ABC' and [Project Code Type]='Admin',[ABC admin target],&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;if([Last Name]='ABC' and [Project Code Type]='Client',[ABC client target],&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;if([Last Name]='ABC' and [Project Code Type]='Internal',[ABC internal target]))&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 10pt;"&gt;Thanks, Maria&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 20:13:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174511#M43307</guid>
      <dc:creator />
      <dc:date>2010-11-05T20:13:23Z</dc:date>
    </item>
    <item>
      <title>If Else statement into Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174512#M43308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe do the same for the others and add them together? I also recommend single quotes instead of double quotes for literals. Double quotes specify a search string, which while it returns the exact same results, might take a different and slightly less efficient path through the system. So single quotes for literals, double quotes for search strings.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum({&amp;lt;[Last Name]={'ABC'},[Project Code Type]={'Admin'} &amp;gt;} [ABC admin target])&lt;BR /&gt;+sum({&amp;lt;[Last Name]={'ABC'},[Project Code Type]={'Client'} &amp;gt;} [ABC client target])&lt;BR /&gt;+sum({&amp;lt;[Last Name]={'ABC'},[Project Code Type]={'Internal'}&amp;gt;} [ABC internal target])&lt;/P&gt;&lt;P&gt;However, if those are the ONLY three project code types, this might be just as efficient, possibly even better (on the down side, to me, the above is more clear):&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum({&amp;lt;[Last Name]={'ABC'}&amp;gt;}&lt;BR /&gt; pick(match([Project Code Type],'Admin','Client','Internal')&lt;BR /&gt; ,[ABC admin target],[ABC client target],[ABC internal target]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 20:22:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174512#M43308</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-11-05T20:22:44Z</dc:date>
    </item>
    <item>
      <title>If Else statement into Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174513#M43309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, I did try that, but it doesn't work. I think it may have to do with the fact that I don't actually need to sum up these variables, but in order to use Set Analysis, I need to do some kind of summation or aggregation, right?&lt;/P&gt;&lt;P&gt;Maria&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 20:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174513#M43309</guid>
      <dc:creator />
      <dc:date>2010-11-05T20:50:46Z</dc:date>
    </item>
    <item>
      <title>If Else statement into Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174514#M43310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want an aggregation, then you don't want set analysis. You COULD use only() where I used sum() to force it to work, but I think it will actually be less efficient than what you started with. I'd stick with your nested if(), or replace it with this less clear but more compact version:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;if([Last Name]='ABC'&lt;BR /&gt; ,pick(match([Project Code Type],'Admin','Client','Internal')&lt;BR /&gt; ,[ABC admin target],[ABC client target],[ABC internal target]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 21:09:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Else-statement-into-Set-Analysis/m-p/174514#M43310</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-11-05T21:09:37Z</dc:date>
    </item>
  </channel>
</rss>

