Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  Calculation related question

    Posted Wed March 23, 2022 05:18 PM
    Edited by System Admin Fri January 20, 2023 04:16 PM
    Hello,

    I am new to this group and new to Cognos, so if this question is not asked to the right group then please pardon my ignorance.

    I have two tables as explained below.

    1. Accounting Year table: contains one row for each accounting year and the budget amount. There are multiple accounting years.
    Accounting Year     Budget Amount
    2020-21                    $ 200,000.00
    2021-22                    $ 250,000.00

    2. Expenses table: contains multiple row for expenses throughout the accounting years.
    Accounting Year     Invoice Date    Invoice Amount
    2020-21                     10/1/2020        $ 30,000.00 
    2021-22                     7/1/2021          $ 50,000.00
    2021-22                     8/10/2021        $ 60,000.00


    I want to create a dashboard for Accounting Year 2021-22 that shows Accounting Year, Budget Amount, Total Invoice Amount, and Remaining Budget.
    Accounting Year     Budget Amount      Amount Invoiced      Remaining Budget
    2021-22                    $ 250,000.00            $ 110,000.00              $ 140,000.00

    When I create a calculated field, 'Remaining Budget' that substracts total of 'Invoice Amount' (for Accounting Year 2021-22) from the 'Budget Amount' (for Accounting Year 2021-22), and tried to show it as a summary visualization on the dashboard, it does not give me correct remaining budget amount. It shows more amount. What is the correct way to get the Remaining Budget amount?

    Thank you!

    ------------------------------
    Hiren D. Vashi
    ------------------------------
    #CognosAnalyticswithWatson


  • 2.  RE: Calculation related question

    Posted Thu March 24, 2022 02:06 AM
    Hello,

    if your data source is a data module, you need to apply column dependencies as both tables are at different grain levels.
    https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=metadata-column-dependencies

    If it's a package from Framework Manager, then the author of this package needs to apply determinants.
    https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=subjects-determinants

    Both techniques avoid double counting on data.

    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ
    Ingelfingen
    ------------------------------



  • 3.  RE: Calculation related question

    Posted Thu March 24, 2022 04:12 PM
    Edited by System Admin Fri January 20, 2023 04:38 PM


    Column dependency will guard the summary from double counting when you project a dimension below it fact grain but expressions which use facts from different grains will produce what seems like incorrect results. although logically correct given what is being asked of it. After all, the sum of 914,965 less 1,224,340 is -309,375.

    You would need to summarize the values up to the grain of the other fact table, with the most likely approach, because it will create an object which is usable in many places, to be to create a summary table (either in your data base or in the module).

    Here is a report where I have facts from my sales fact table and my product forecast fact table.  The former has a grain of day.  The latter has a grain of month.  Because of that, a calculation to determine the variance between the two facts will be using day level sales quantity values and subtracting from that the month level expected volume values.  I also have a summary table which has, through my YearMonthKey, which is at the month level, summarized the values of quantity to the month level.  As you can see, the calculation which determines the variance between that quantity and expected volume produces a month level value

    Summary table to aggregate a fact up to a higher fact grain in order to perform calculations with other fact tables





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



  • 4.  RE: Calculation related question

    Posted Thu March 24, 2022 05:55 PM
    Hello Ian,

    I am going to use column dependencies because that is what I was missing.

    Thanks for the detailed explanation!



    ------------------------------
    Hiren Vashi
    ------------------------------



  • 5.  RE: Calculation related question

    Posted Thu March 24, 2022 05:51 PM
    Hello Robert,

    That is exactly what I was missing in my setup. Column dependencies is what I haven't set up yet. I will work on setting it up and will get back.

    Thank you so much!

    ------------------------------
    Hiren Vashi
    ------------------------------



  • 6.  RE: Calculation related question

    Posted Fri March 25, 2022 12:21 PM

    Hi Hiren, 

    Took you data and put it into an Excel spreadsheet with budget and expense tabs and I created an Accounting year tab. A relationship between Accounting Year to Budget and a relationship to expense was created. Also a relationship from budget to expense was created which I deleted.

    I suspect in your data module you have a 1 to many relationship between budget and expense. This is causing the double counting budget amount.

    By using accounting year from the accounting year table I created aggregation occurs correctly and calculation 

    Budget.Budget_Amount -  Expenses.Invoice_Amount  

    returns the correct remaining budget amount. 

    hope that helps





    ------------------------------
    ROBERT PANGBORN
    ------------------------------



  • 7.  RE: Calculation related question

    Posted Fri March 25, 2022 12:38 PM
    Hi Robert,

    You are right. I do have one to many relationship between budget and expense.

    I will add accounting year table now. This makes complete sense.

    Thank you so much for your help!!! Appreciate it!


    ------------------------------
    Hiren Vashi
    ------------------------------