2 Replies Latest reply: Mar 11, 2016 11:00 AM by Edgar Lensing RSS

    Set analysis behave strange.

    Edgar Lensing

      Hi,

      I am working with Set analysis to create some KPIs in a dashboard.

       

      To understand it correctly I am still going with tests.

       

      I have this KPI function:

      Sum( aggr ( { $ <filter_date = {'$(=date(floor(Max( {$<[filter_date]=>} discoverydate))))'} >}

          price, product_id, filter_date) )

       

      I have a current selection, with one product_id and one merchant, thus I should have one product with one price.

      As I go with this set analysis I expect that the Sum of the one record should be the price of that product.

       

      But if I have no filter_date selection in the current selection, I get a higher value.

      Only if I set the filter_date by myself in the selection the Sum equals one price.

       

      Is the Set analysis wrong?

        • Re: Set analysis behave strange.
          Stefan Wühl

          Not quite sure what your setting is, have a look at

          Set Analysis in the Aggr function

          So try with adding the set analysis to the outer aggregation, too:

          Sum({ $ <filter_date = {'$(=date(floor(Max( {$<[filter_date]=>} discoverydate))))'} >}

          aggr ( { $ <filter_date = {'$(=date(floor(Max( {$<[filter_date]=>} discoverydate))))'} >}

              price, product_id, filter_date) )

            • Re: Set analysis behave strange.
              Edgar Lensing

              Ok, I tried with 2 Sets before, but there are more things to be right.

               

              I thought because of the reduced data, that I don't need that much dimensions in the AGGR.

              But if I leave out the filter_date as dimension, it doesn't find data. The matrix seemed to be calculated and then the data is cut out depending from the Set.

               

              What I now have:

              (Dunno why this editor puts it as table)

              Sum( { $ <filter_date = {'$(=date(floor(Max( {$<[filter_date]=>} filter_date))))'}, calc_merchant= {"OWN_CLIENT_DATA_FLAG"} >}
              aggr ( { $ <filter_date = {'$(=date(floor(Max( {$<[filter_date]=>} filter_date))))'}, calc_merchant= {"OWN_CLIENT_DATA_FLAG"} >}
                 price * selling_quantity, product_id, calc_merchant, filter_date) )

               

              I need cals_merchant as dimension because otherwise there are empty values for selling_quantity and thus even with the cals_merchant set to "OWN_CLIENT..." (where I have values for the selling_quantity) the AGGR is build in a wrong way.

               

              I think I am near 80% to get it.

              Thx for the help.