7 Replies Latest reply: Mar 22, 2016 7:49 AM by Edgar Lensing RSS

    Nested 'measure' in Set expression

    Edgar Lensing

      Hi,

      I have a table with merchants as Dimension.

       

      This table should show data for one specific product_id.

       

      I managed this by using a variable.

       

      As 2nd dimension i use:

      Only(aggr( Max( {$ <product_id = {'$(varDetailProductId)'}, filter_date = >} discoverydate), offer_merchant))

       

      which basically is the latest date where we have a price information for that merchant.

      so i end up with only one row per merchant.

       

      now i want more columns:

      * the price on that latest date

      * the price on the date before

       

      I tried:

      min( {$ <product_id = {'$(varDetailProductId)'}, filter_date = {'$(aggr( Max( {$ <product_id = {$'(varDetailProductId)'}, filter_date = >} discoverydate), offer_merchant)))'} >} price)

       

      but as i have two nested measures (the aggr and the inner var) the ' is not escaped.

      but even if i could escape that, i am not sure it will work. :/

       

      bottom line:

      if I use

      { $ <some_field = {'$(myExp( other_fields))'} >}

      what i called "nested" is it possible to nest this whole expression agin inside another set expression?