<?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 set analysis formula comparable to sql's 'in' command? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294407#M843588</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have set a variable equal to a field selection like so:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vSelectedYear = GetFieldSelections(YearField)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sometimes vSelectedYear will hold multiple values (2017, 2016, etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The set analysis formula looks like such right now: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(&amp;nbsp; {&amp;lt;YearField = {"$(=$(vSelectedYear))"} &amp;gt;}&amp;nbsp; [$(vType)])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this works fine if only one year is selected, but I would like it to work when vSelectedYear holds multiple years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Sql it would look like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Select sum(vType)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;from table &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;where YearField in (vSelectedYear)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>bekahbeets</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>set analysis formula comparable to sql's 'in' command?</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294407#M843588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have set a variable equal to a field selection like so:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vSelectedYear = GetFieldSelections(YearField)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sometimes vSelectedYear will hold multiple values (2017, 2016, etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The set analysis formula looks like such right now: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(&amp;nbsp; {&amp;lt;YearField = {"$(=$(vSelectedYear))"} &amp;gt;}&amp;nbsp; [$(vType)])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this works fine if only one year is selected, but I would like it to work when vSelectedYear holds multiple years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Sql it would look like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Select sum(vType)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;from table &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;where YearField in (vSelectedYear)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294407#M843588</guid>
      <dc:creator>bekahbeets</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis formula comparable to sql's 'in' command?</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294408#M843589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should work if you remove the double quotes (assuming integer values for years):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum(&amp;nbsp; {&amp;lt;YearField = {$(=$(vSelectedYear))} &amp;gt;}&amp;nbsp; [$(vType)])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Or use the p() function or the scope operator to directly acces field values selected or possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum(&amp;nbsp; {&amp;lt;YearField = $::YearField &amp;gt;}&amp;nbsp; [$(vType)])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum(&amp;nbsp; {&amp;lt;YearField = p(YearField) &amp;gt;}&amp;nbsp; [$(vType)])&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(though latter set expression should not make a difference to just the pure aggregation?)&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2017 21:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294408#M843589</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-04-10T21:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis formula comparable to sql's 'in' command?</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294409#M843590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! Removing the quotes did the trick!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2017 21:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-formula-comparable-to-sql-s-in-command/m-p/1294409#M843590</guid>
      <dc:creator>bekahbeets</dc:creator>
      <dc:date>2017-04-10T21:42:16Z</dc:date>
    </item>
  </channel>
</rss>

