Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  Visualizing % change

    Posted Fri April 24, 2020 04:11 PM
    Hello, I'm new to Cognos and trying to bootstrap my knowledge of data models and visualizations.

    Can anyone point me to instructions for creating a line chart showing percent change from one year to the next? 
    How about percent change since the first year of the data set?

    ------------------------------
    Susan Ray
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Visualizing % change

    Posted Wed July 20, 2022 02:20 PM
    Edited by System Admin Fri January 20, 2023 04:41 PM
      |   view attached
    I could still use help with this. 
    Actually, for my current report a simple cross tab would be sufficient  (see mock up, attached).

    Any Suggestions?

    ------------------------------
    Susan Ray
    ------------------------------

    Attachment(s)



  • 3.  RE: Visualizing % change
    Best Answer

    Posted Thu July 21, 2022 02:56 AM

    There are a few ways of calculating percent change, but it's really down to what type of database you're using. Is this a dimensional (e.g. TM1, SSAS, DMR) or a relational (e.g. SQL Server, Oracle, DB2) source? 

    If it's a dimensional you'll want to tuple on the previous member of the year. tuple([Measure],prevMember(currentMember([Cube].[Date Dim].[Date Hier])))

    Relational is a little more complicated. I would use moving-total([Measure],2) - [Measure]
    Moving-total takes the total of the current and n-1 previous rows. So moving-total([Measure],2)-[Measure] will return the previous rows value. 


    It gets complicated if you have another attribute in your output though:

    Obviously the prev year for 2011,Camping equipment is wrong. So we have to limit the moving-total to window on Year:
    moving-total([Revenue],2 for [Product line]) - [Revenue]

    Essentially it's grouping each value in Product line into it's own table, and then doing the moving-total like before. Additional data items can be included by adding the item to the FOR clause:
    moving-total([Measure],2 for [Product line],[Region]) 

    Now, once you have the previous year value, the next step is to make ANOTHER measure. This one does the actual variance calculation, and is the same for both dimensional and relational sources:
    ([Measure] - [PrevYear Measure]) / [PrevYear Measure]



    That will work great in graphs and crosstabs:





    Hope that helps!



    ------------------------------
    Paul Mendelson
    ------------------------------



  • 4.  RE: Visualizing % change

    Posted Thu July 21, 2022 12:25 PM
    In the relational world the running- and total-functions are a bit tricky and it might take a bit to get used to them. But they are quite powerfull and can solve many of such "dimensional" questions.

    ------------------------------
    Philipp Hornung
    ------------------------------



  • 5.  RE: Visualizing % change

    Posted Mon July 25, 2022 10:00 AM
    nice

    ------------------------------
    Kart Butik
    Kart Butik
    ------------------------------