Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Weighted Average in Cognos 11.1

    This message was posted by a user wishing to remain anonymous
    Posted Tue February 26, 2019 03:43 AM
    This message was posted by a user wishing to remain anonymous

    Hi, 

    I would like to calculate the weighted average in Cognos, such as "sum (Revenue * Quantity)/ sum (Quantity)", but instead I get "total(Quantity)*total(Revenue)/ total (Quantity)". 
    Does anyone know how to solve this? 

    Also, I am looking for the "aggregate then calculate" function. This was supposed to be in Properties of the variable, but I can't seem to find it. 

    Any help is much appreciated! Thank you

    #CognosAnalyticswithWatson


  • 2.  RE: Weighted Average in Cognos 11.1

    Posted Tue February 26, 2019 06:35 PM
    The calculated aggregation property value is available for stand-alone calculations.  It is not available for calculations which are created in query subjects.

    ------------------------------
    IAN HENDERSON
    ------------------------------



  • 3.  RE: Weighted Average in Cognos 11.1

    Posted Wed February 27, 2019 12:16 AM
    Here is an example based on the gosales sample model.

    total ( ORDER_DETAILS.QUANTITY * ORDER_DETAILS.UNIT_COST ) / total ( ORDER_DETAILS.QUANTITY )

    Using this on a small sample of the data gives the following output:

    The aggregation of the [Unit Cost] column is set to <average>.

    ------------------------------
    HENK CAZEMIER
    ------------------------------



  • 4.  RE: Weighted Average in Cognos 11.1

    Posted Wed February 27, 2019 12:17 PM
    Ian & Henk; thank you so much for your time and effort in helping me! You have solved the problem.

    ------------------------------
    Stephanie Wagenaar
    ------------------------------