<?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 Nested 'measure' in Set expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038519#M16101</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 have a table with merchants as Dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table should show data for one specific product_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed this by using a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As 2nd dimension i use:&lt;/P&gt;&lt;P&gt;Only(aggr( Max( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = &amp;gt;} discoverydate), offer_merchant))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which basically is the latest date where we have a price information for that merchant.&lt;/P&gt;&lt;P&gt;so i end up with only one row per merchant. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want more columns:&lt;/P&gt;&lt;P&gt;* the price on that latest date&lt;/P&gt;&lt;P&gt;* the price on the date before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;min( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = {'$(&lt;STRONG&gt;aggr( Max( {$ &amp;lt;product_id = {$'(varDetailProductId)'}, filter_date = &amp;gt;} discoverydate), offer_merchant))&lt;/STRONG&gt;)'} &amp;gt;} price)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but as i have two nested measures (the aggr and the inner var) the ' is not escaped.&lt;/P&gt;&lt;P&gt;but even if i could escape that, i am not sure it will work. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bottom line:&lt;/P&gt;&lt;P&gt;if I use&lt;/P&gt;&lt;P&gt;{ $ &amp;lt;some_field = {'&lt;STRONG&gt;$(myExp( other_fields))&lt;/STRONG&gt;'} &amp;gt;}&lt;/P&gt;&lt;P&gt;what i called "nested" is it possible to nest this whole expression agin inside another set expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Mar 2016 14:22:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-21T14:22:54Z</dc:date>
    <item>
      <title>Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038519#M16101</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 have a table with merchants as Dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table should show data for one specific product_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed this by using a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As 2nd dimension i use:&lt;/P&gt;&lt;P&gt;Only(aggr( Max( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = &amp;gt;} discoverydate), offer_merchant))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which basically is the latest date where we have a price information for that merchant.&lt;/P&gt;&lt;P&gt;so i end up with only one row per merchant. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want more columns:&lt;/P&gt;&lt;P&gt;* the price on that latest date&lt;/P&gt;&lt;P&gt;* the price on the date before&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;min( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = {'$(&lt;STRONG&gt;aggr( Max( {$ &amp;lt;product_id = {$'(varDetailProductId)'}, filter_date = &amp;gt;} discoverydate), offer_merchant))&lt;/STRONG&gt;)'} &amp;gt;} price)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but as i have two nested measures (the aggr and the inner var) the ' is not escaped.&lt;/P&gt;&lt;P&gt;but even if i could escape that, i am not sure it will work. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bottom line:&lt;/P&gt;&lt;P&gt;if I use&lt;/P&gt;&lt;P&gt;{ $ &amp;lt;some_field = {'&lt;STRONG&gt;$(myExp( other_fields))&lt;/STRONG&gt;'} &amp;gt;}&lt;/P&gt;&lt;P&gt;what i called "nested" is it possible to nest this whole expression agin inside another set expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2016 14:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038519#M16101</guid>
      <dc:creator />
      <dc:date>2016-03-21T14:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038520#M16102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's rather convoluted. Why such a complicated calculated dimension?&lt;/P&gt;&lt;P&gt;Using an expression instead of a calculated dimension looks much easier to me:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = &amp;gt;} discoverydate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&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; font-size: 13px;"&gt;The other columns could be&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = &amp;gt;} price ,-discoverydate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue( {$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = &amp;gt;} price ,-discoverydate, 2)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2016 14:35:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038520#M16102</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-21T14:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038521#M16103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I started using it like you mentioned it, but it told me that this is a invalid dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I instead use this as measure, I have all the merchants in my list even those who have no offer for the specified product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can I add the Set expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{$ &amp;lt;product_id = {'$(varDetailProductId)'}, filter_date = &amp;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; font-size: 13px;"&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; font-size: 13px;"&gt;to the merchant dimension field?0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&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; font-size: 13px;"&gt;or as more generall question:&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&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; font-size: 13px;"&gt;Can i use a set expression for a whole table (later hypercube)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Such as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Show me the dimensions and measures but do this on data where { $ ... } is valid.&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; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2016 14:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038521#M16103</guid>
      <dc:creator />
      <dc:date>2016-03-21T14:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038522#M16104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;btw: the prices works great so far &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;THX,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I need to check, how to reduce the merchants to the given product only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2016 15:00:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038522#M16104</guid>
      <dc:creator />
      <dc:date>2016-03-21T15:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038523#M16105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I started using it like you mentioned it, but it told me that this is a invalid dimension.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's because it is, as I said, not a calculated dimension, but an expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2016 16:31:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038523#M16105</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-21T16:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038524#M16106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I understand that now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea to my other problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I reduce the one used dimension with something like a set expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 08:44:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038524#M16106</guid>
      <dc:creator />
      <dc:date>2016-03-22T08:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038525#M16107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What problem is that? I think I already posted an expression you should use instead of a calculated dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 11:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038525#M16107</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-22T11:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Nested 'measure' in Set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038526#M16108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought I could not put any condition to a dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus i searched a way to reduce the dimensions to the rows I want to show.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now work found how to deal with that.&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;if (product_id = $(varDetailProductId), product_id)&lt;/P&gt;&lt;P&gt;as dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I will be able to build my table now.&lt;/P&gt;&lt;P&gt;Thx for ur help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2016 11:49:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Nested-measure-in-Set-expression/m-p/1038526#M16108</guid>
      <dc:creator />
      <dc:date>2016-03-22T11:49:43Z</dc:date>
    </item>
  </channel>
</rss>

