<?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: Set Analysis Error - Setting value when no selections are made in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1733987#M56051</link>
    <description>&lt;P&gt;You are getting an error because you can't do a IF-statement inside a set analysis.&lt;/P&gt;&lt;P&gt;However, you can do it, if you put your if-statement in a variable - let's call that variable v_NoSelection with the value:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(GetSelectedCount([Multi Outlet])=0,'Total US - Multi Outlet',[Multi Outlet])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then your final expression will look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({$&amp;lt;[Multi Outlet] = {"$(v_NoSelection)"}&amp;gt;}[DS Sales])&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2020 06:53:54 GMT</pubDate>
    <dc:creator>inspari_dfg</dc:creator>
    <dc:date>2020-08-07T06:53:54Z</dc:date>
    <item>
      <title>Set Analysis Error - Setting value when no selections are made</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1733947#M56045</link>
      <description>&lt;P&gt;I need to set a value when a selection has not been made. There is something wrong with this statement but I cannot figure out what:&lt;/P&gt;&lt;P&gt;Target Output if no selections have been made: (Sum{&amp;lt;[Multi Outlet]='Total US - Multi Outlet'&amp;gt;}[DS Sales])&lt;/P&gt;&lt;P&gt;Target Output if selections have been made:&amp;nbsp;(Sum{&amp;lt;[Multi Outlet]=&lt;FONT color="#0000FF"&gt;Selected&lt;/FONT&gt;&amp;gt;}[DS Sales])&lt;/P&gt;&lt;P&gt;My set analysis that is erroring out:&amp;nbsp;&lt;STRONG&gt;Sum({$&amp;lt;[Multi Outlet] = {$(=If(GetSelectedCount([Multi Outlet])=0,'Total US - Multi Outlet',[Multi Outlet]))}&amp;gt;}[DS Sales])&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:15:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1733947#M56045</guid>
      <dc:creator>rougeherring</dc:creator>
      <dc:date>2024-11-16T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Error - Setting value when no selections are made</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1733987#M56051</link>
      <description>&lt;P&gt;You are getting an error because you can't do a IF-statement inside a set analysis.&lt;/P&gt;&lt;P&gt;However, you can do it, if you put your if-statement in a variable - let's call that variable v_NoSelection with the value:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(GetSelectedCount([Multi Outlet])=0,'Total US - Multi Outlet',[Multi Outlet])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then your final expression will look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({$&amp;lt;[Multi Outlet] = {"$(v_NoSelection)"}&amp;gt;}[DS Sales])&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 06:53:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1733987#M56051</guid>
      <dc:creator>inspari_dfg</dc:creator>
      <dc:date>2020-08-07T06:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Error - Setting value when no selections are made</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1734079#M56065</link>
      <description>&lt;P&gt;You can also try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=If(GetSelectedCount([Multi Outlet])=0,
  Sum({$&amp;lt;[Multi Outlet] = {'Total US - Multi Outlet'}&amp;gt;} [DS Sales]),
  Sum([DS Sales])
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Aug 2020 11:52:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Error-Setting-value-when-no-selections-are-made/m-p/1734079#M56065</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-08-07T11:52:51Z</dc:date>
    </item>
  </channel>
</rss>

