7 Replies Latest reply: Dec 27, 2016 5:06 AM by Gysbert Wassenaar RSS

    Combine different if statements

    Tim Schoeters

      I need to make a bar chart of the sales of a particular department and certain type of fruit and that for the previous 12 months by month.

       

      So I want a graph with on the X axis 01-2016 , 02-2016, 03-2016 and for each month the sale of Apples for the new department.

       

      to calculation of the sales for the department and fruit is done by:

       

      =Sum({<Group = {New}, Fruit = {Apple} >} [Sales])

       

      This gives me back the Sales for Apples in the new group

       

      To present the previous 12 months in the graph I use this:

       

      =Sum ({$<K_Period={">=$(=$(vPeriodStartYear))<=$(=Max(K_Period))"},K_Year=,K_Month=>}Sales)

       

      This gives me all sales of all fruits and

       

      So I want to combine both statements but everything i tried so far failed.