2 Replies Latest reply: Aug 12, 2014 3:31 AM by Gullik Vetvik Killie RSS

    Using an expression within an expression with set analysis



      I have an expression that calculates the sum of sales and selects the year to be the last year.


      let exprSumSales = 'sum({$<

                                               FactType = {$1},

                                               Year = {"'&Chr(36)&'(=Max(Year))"}

                                              >} Sales)';


      This is called with =$(exprSumSales(Accounting)) and =$(exprSumSales(Budget)) in a straight table to find the sum of sales and the sum of budgets


      Then I want to make an expression that calculates the difference between one type of sales and another one.


      let exprDiffSales = 'exprSumSales($1) - exprSumSales($2)';


      When calling with the exprDiffSales(Budget, Accounting) the Max(Year) search fails and returns empty I think.


      Is there a way around it must I write the whole expression in the exprDiffSales.