<?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 Variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284560#M1195191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am trying to get the Value 'Site1' into the Sub Sites field setting (there are lots of Possible values for this Site1,Site2 etc the value is stored in the AlternativeSupply field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 May 2011 14:48:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-09T14:48:34Z</dc:date>
    <item>
      <title>Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284558#M1195189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Could someone help me with the following please ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;I have an expression like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: arial,helvetica,sans-serif;"&gt;if(AlternativeSupply='Site1',SUM({&amp;lt;[Measures-Groups]={'Cost'},[Versions]={'Actual'},[Sub Sites]={'Site1'}&amp;gt;} Total Data) )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: arial,helvetica,sans-serif;"&gt;This works fine but I would like to embed the &lt;/SPAN&gt;AlternativeSupply into the Sub Site to save me a long list of 'if' statements something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;SUM({&amp;lt;[Measures-Groups]={'Cost'},[Versions]={'Actual'},[Sub Sites]={AlternativeSupply}&amp;gt;} Total Data) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;but I don't seem to be able to get the syntax right ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 13:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284558#M1195189</guid>
      <dc:creator />
      <dc:date>2011-05-09T13:59:37Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284559#M1195190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if AlternativeSupply is a value inside the Sub Sites Field, you can try to add the&amp;nbsp; ' '&amp;nbsp; that you use in all the other selections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 14:35:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284559#M1195190</guid>
      <dc:creator />
      <dc:date>2011-05-09T14:35:07Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284560#M1195191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am trying to get the Value 'Site1' into the Sub Sites field setting (there are lots of Possible values for this Site1,Site2 etc the value is stored in the AlternativeSupply field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 14:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284560#M1195191</guid>
      <dc:creator />
      <dc:date>2011-05-09T14:48:34Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284561#M1195192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you have to do this :&lt;/P&gt;&lt;P&gt;[code]SUM({&amp;lt;[Measures-Groups]={'Cost'},[Versions]={'Actual'},[Sub Sites]={"$(=Only(AlternativeSupply))"}&amp;gt;} Total Data)[/code]&lt;/P&gt;&lt;P&gt;Hope that helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin Favier, Acssi, Lille / Nord / France&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 14:52:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284561#M1195192</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2011-05-09T14:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284562#M1195193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax for field-selection expression in set analysis expression seems to be &lt;STRONG&gt;&lt;EM&gt;FieldName = {FieldValue}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have tried to use FieldName = {FieldName}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably, that is why it is failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add a field to your file after applying the 'If' conditions and add that field in your set expression, it will work. Probably it is a work-around.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I did not have your data or qvw file, I checked this using my own data in the attached qvw file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this example helps you to solve your situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 14:57:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284562#M1195193</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-05-09T14:57:06Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284563#M1195194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that the issue might be that there is no single value for Alternative supply once I have in inside the Sum/Total Function that is why the 'If' version of the expression works and the combined version doesn't. Is there a way to set a variable before the SUM Function that I can then use within it ? So something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable1 = AlternativeSupply&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #333333; font-family: arial,helvetica,sans-serif;"&gt;SUM({&amp;lt;[Measures-Groups]={'Cost'},[Versions]={'Actual'},[Sub Sites]={Variable1}&amp;gt;} Total Data) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2011 12:08:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284563#M1195194</guid>
      <dc:creator />
      <dc:date>2011-05-12T12:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284564#M1195195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you could set a cariable in the script with that value and then use the dollar sign expansion to get its value.&lt;/P&gt;&lt;P&gt;Enviado desde mi Blackberry® 3G de Iusacell.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2011 13:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284564#M1195195</guid>
      <dc:creator />
      <dc:date>2011-05-12T13:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284565#M1195196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I think Martin Favier was near the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's not &lt;EM&gt;&lt;STRONG&gt;[Sub Sites]={"$(=Only(AlternativeSupply))"}&lt;/STRONG&gt;&lt;/EM&gt; but &lt;EM&gt;&lt;STRONG&gt;[Sub Sites] ={"$(AlternativeSupply)"}&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will replace the variable AlternativeSupply by its value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2011 15:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284565#M1195196</guid>
      <dc:creator />
      <dc:date>2011-05-16T15:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284566#M1195197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is definately along the lines of what I'm after but it still doesn't seem to work I have put both those lines in the set analysis along with an example of what I'm trying to achieve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 10:53:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284566#M1195197</guid>
      <dc:creator />
      <dc:date>2011-05-17T10:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284567#M1195198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if it's normal, but in the example you gave, the variable AlternativeSupply doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is the reason why it doesn't work here, if in your real document, this variable exists and has a value that is supposed to work, I don't know how to solve your problem, sorry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit : I tried to create the variable and put the value "Site1" in it, and it seems to work, the 4th colum (my solution) took the value "14"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 11:49:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284567#M1195198</guid>
      <dc:creator />
      <dc:date>2011-05-17T11:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284568#M1195199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry it should have been AlternativeSite but this isn't the issue.I am able to put a single value in a variable as you have but it falls down when I introduce a variable value in the variable. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help anyway I can work around it for now it just limits what I can do in the future with the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it was excel I would use the INDIRECT function that you can use to build function text with variables but I can't find a similar function in Qlikview. Maybe it's not possible.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 12:13:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284568#M1195199</guid>
      <dc:creator />
      <dc:date>2011-05-17T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284569#M1195200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't do it with set analysis because a set is analyzed for the entire chart, not once per row.&amp;nbsp; Well, technically you CAN do it with set analysis, but it's rather complicated, and not always faster than an if(), so let's set that aside for now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about just changing the data model to add an AlternativeCost?&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;LEFT JOIN (YourTable)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Site as AlternativeSite&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,Cost as AlternativeCost&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT (YourTable)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course if you have 50 different fields you want to see for the alternative site, this isn't very practical, but it seems doable for just a field or two.&amp;nbsp; Denormalization isn't a problem since this is all read only, and QlikView's compression should take care of any extra space requirements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 23:59:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Variable/m-p/284569#M1195200</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-17T23:59:48Z</dc:date>
    </item>
  </channel>
</rss>

