Cognos Calculate Variance Crosstab (Relational) -


I have a simple cross.tab such as:

  trans | Pants | Shirt | | 2013 | 2014 | 2013 | 2014 | --------------------------------------- Jan. 33 | 37 | 41 | 53 | February | 31 | 33 | 38 | 43 | March | 26 | 29 | 51 | 56 | Pants and shirts are related to data items:  category    
  • For year data related to: year

  • The months are related to the data item: months

  • The Trans data relates to the item: Trans

    Report Studio looks like this:

      Trans | & Lt; # Category # & gt; | & Lt; # Category # & gt; | | & Lt; # Years # & gt; | & Lt; # Years # & gt; | & Lt; # Years # & gt; | & Lt; # Years # & gt; | -------------------------------------------------- --------- & lt; # Months # & gt; | & Lt; # 1234 # & gt; | & Lt; # 1234 # & gt; | & Lt; # 1234 # & gt; | & Lt; # 1234 # & gt; |   

    I want to be able to calculate the deviation of pants and shirts over the years. To get something like this:

      Trans | Pants | Shirt | | 2013 | 2014 | YOY variation | 2013 | 2014 | YOY variation | -------------------------------------------------- ------------------- Jan | 33 | 37 | 12.12 | 41 | 53 | 29.27 | February | 31 | 33 | 6.45 | 38 | 43 | 13.16 | March | 26 | 29 | 11.54 | 51 | 56 | 9.80 |   

    I have tried putting a data item for YOY variants with the expression below, to see if I can get the value of 2014 but can not , Some strange reason it only returns 2013 values: maximum [year], [class], for [months]

    any ideas ? help?

    (I assume that you do not have a DMR.)

    Connos There is no easy / clear way to do this in your query, you have to calculate each year in your output. So, something like that for 2013:

      total (if [years] = 2013) then ([trans]) and (0))   

    and Originally the same for 2014.

    To cut the slice across your crossab, you will snatch those two casals under your years to get rid of all the void or faucet, choose two columns. From the menu, press data , , just press the column .

    In the end, you will drop a cal in the next to your year in crosstab (not under them). Expression be ([2014 trans] - [2013 trans]) / [2014 trance] (or whatever you end by giving your call name). Format it as a percentage, and you'll love to go.

    You told that it was a pain!

  • Comments

    Popular posts from this blog

    Verilog Error: output or inout port "Q" must be connected to a structural net expression -

    jasper reports - How to center align barcode using jasperreports and barcode4j -

    c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -