<?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 embedded expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728480#M1069314</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Region = {$(=Concat(DISTINCT Chr(39) &amp;amp; Region &amp;amp;Chr(39),','))},Brand={'XXX'},Territory=&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2014 07:38:37 GMT</pubDate>
    <dc:creator>Sokkorn</dc:creator>
    <dc:date>2014-08-22T07:38:37Z</dc:date>
    <item>
      <title>Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728477#M1069311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my data set, I have 4 regions, each region having 10 territories.&amp;nbsp; I am trying to get a region sales total when a territory is selected by using the mid function as region is always the first 2 characters of territory.&amp;nbsp; Brand XXX is constant.&amp;nbsp; In the example data set, If I filter on Territory A11, I would like to see the total for Region A1 (Sales = 30).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this formula but cannot get it to work.&amp;nbsp; Not married to the mid formula so if there is a better way, I would be most appreciative.&lt;/P&gt;&lt;P&gt;sum({&amp;lt; [Region Code]={'=mid([Territory Code],1,2)' }, [Brand] = {'XXX'}&amp;nbsp; &amp;gt;} [Sales])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example Data set :&lt;/P&gt;&lt;P&gt;Territory,Region, Brand, Sales&lt;/P&gt;&lt;P&gt;A11, A1, XXX, 10&lt;/P&gt;&lt;P&gt;A12, A1, XXX, 10&lt;/P&gt;&lt;P&gt;A13, A1, XXX, 10&lt;/P&gt;&lt;P&gt;A21, A2, XXX, 20&lt;/P&gt;&lt;P&gt;A22, A2, XXX, 20&lt;/P&gt;&lt;P&gt;A23, A2, XXX, 20&lt;/P&gt;&lt;P&gt;A11, A1, YYY, 100&lt;/P&gt;&lt;P&gt;A12, A1, YYY, 100&lt;/P&gt;&lt;P&gt;A13, A1, YYY, 100&lt;/P&gt;&lt;P&gt;A21, A2, YYY, 200&lt;/P&gt;&lt;P&gt;A22, A2, YYY, 200&lt;/P&gt;&lt;P&gt;A23, A2, YYY, 200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help you can offer&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:24:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728477#M1069311</guid>
      <dc:creator />
      <dc:date>2014-08-22T07:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728478#M1069312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({&amp;lt; [Region Code]={'=$(mid([Territory Code],1,2))' }, [Brand] = {'XXX'}&amp;nbsp; &amp;gt;} [Sales])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728478#M1069312</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2014-08-22T07:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728479#M1069313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as per the data provided:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below code is working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt; [Region]={'$(=mid([Territory],1,2))' }, [Brand] = {'XXX'}&amp;nbsp; &amp;gt;} [Sales])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:34:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728479#M1069313</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2014-08-22T07:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728480#M1069314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;Region = {$(=Concat(DISTINCT Chr(39) &amp;amp; Region &amp;amp;Chr(39),','))},Brand={'XXX'},Territory=&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:38:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728480#M1069314</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2014-08-22T07:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728481#M1069315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create variable with&lt;/P&gt;&lt;P&gt;vSelectedTerritoryCode = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MaxString([Territory Code],1,2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Territory Code]&lt;/SPAN&gt;=, [Region Code]={'$(vSelectedTerritoryCode)' }, [Brand] = {'XXX'}&amp;nbsp; &amp;gt;} [Sales])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 07:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728481#M1069315</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-22T07:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728482#M1069316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sushil and Sokkorn,&lt;/P&gt;&lt;P&gt;Both metrics did not work in my report but did work in the sample data I provided.&amp;nbsp; I believe the issue is that the actual filter I use is a concatenation of the Territory Code and Territory Name ([Territory Code] &amp;amp; ' - ' &amp;amp;&amp;nbsp; [Territory Name}.&lt;/P&gt;&lt;P&gt;When I create a Territory Code list box and use that for filtering, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this as the filter results in the territory level value, not region level value.&amp;nbsp; Can I account for this in the metric definition?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all of your help!&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 08:58:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728482#M1069316</guid>
      <dc:creator />
      <dc:date>2014-08-22T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728483#M1069317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you everyone for your help on this.&amp;nbsp; I have tried all 3 formulas and I cannot get them to work when I put it back into my actual report.&amp;nbsp; The issue is tied to the listbox used to filter for territory.&amp;nbsp; I recreated a test qvw and have attached it below.&amp;nbsp; The goal is to get the formula to work when selecting from the concatenate field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jagan, I changed the MaxString function to Mid as that is what I think the intention was and there were too many arguments to support that MaxString function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 15:47:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728483#M1069317</guid>
      <dc:creator />
      <dc:date>2014-08-22T15:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728484#M1069318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Create variable with&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;vSelectedTerritoryCode = Mid(&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;MaxString([Territory Code]),1,2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;=sum({&amp;lt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;[Territory Code]&lt;/SPAN&gt;=, [Region Code]={'$(vSelectedTerritoryCode)' }, [Brand] = {'XXX'}&amp;nbsp; &amp;gt;} [Sales])&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Jagan.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 16:19:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728484#M1069318</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-08-22T16:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis embedded expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728485#M1069319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could not get that to work but I think I have it by using the aggr function and avoided the substring process.&amp;nbsp; I'm new to qlikview so still learning what all the functions do.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what seems to work:&lt;/P&gt;&lt;P&gt;=aggr(sum( {1&amp;lt; [Brand Name]={'XXX'} &amp;gt;}[Monthly Sales]),[Region Number])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the help is greatly appreciated.&amp;nbsp; Definitely made me dig into different options and furthered my learning&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 16:38:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-embedded-expression/m-p/728485#M1069319</guid>
      <dc:creator />
      <dc:date>2014-08-22T16:38:00Z</dc:date>
    </item>
  </channel>
</rss>

