sum across in crosstab

Hi,
I have a cross tab like this


        |region
        | Year 
-----------------
Week| Amt
        |

The data is displayed like


             A                       B
   | 2004     2003            2004    2003
--|-----------------------------------------
1 |6             7            1          6
2 |4             1            3          7
3 |4             3            1          1

I want to display the following


             A                       B                 Sum
   | 2004     2003           2004    2003          2004   2003
--|------------------------------------------------------------------
1 |6             7            1          6          7        13
2 |4             1            3          7          7        8
3 |4             3            1          1          5        4 

How can I do this?
If I put sum on Amt then it displays sum of all the regions all the years
i.e. sum of A 2004 + A 2003 + B 2004 + B 2003

Akshay


akshay :india: (BOB member since 2004-02-05)

Quick pointer:
Use WHERE in the crosstab footer to your right such as

SUM(<Measure>) WHERE (<Year> = 2003)
SUM(<Measure>) WHERE (<Year> = 2004)

Andreas :de: (BOB member since 2002-06-20)

But I do’nt want to hardcode the numebrs 2004 and 2003

Akshay


akshay :india: (BOB member since 2004-02-05)

Sketch:
Create a second crosstab (using the same objects, but leave out Region), position this new crosstab relative to the right of your original crosstab.


Andreas :de: (BOB member since 2002-06-20)

Hi,
I wanted to add this sum on the left of the crosstab. so I read one of your replies that we can add columns to the right of the first vertical header in the crosstab which is week in my case. i did that and then added a formula saying
“Sum(<Start/Stop Count>) Where (=2004)”

But it says Varaibles are not comaptible
And if i create a variable and insert the formula the variable gets inserted in the column but does not display any data in the column

Akshay


akshay :india: (BOB member since 2004-02-05)

Is of Data Type NUMBER or STRING/CHARACTER?


Andreas :de: (BOB member since 2002-06-20)

It is a dimension.

I am not sure of the data type. It will take time to open the universe and check

What is the possible solution depending on the datatype.

By the way if I insert that variable on the right side of the crosstab then it works but if I insert it on the left side then it does not show the data

Akshay


akshay :india: (BOB member since 2004-02-05)

I’m trying to do a sum in a cross tab, data is as follows,

Cleint, Jan 04, Feb04, Mar04, April04, Only Jan and Feb Summed
John, 10, 20, 50, 100, 30
Chris, 10, 20, 50, 100, 30

Is possible to rescrict the sum on a cross tab to specific months ?
I can do it to one month using,

=Sum( Where ( = “Jan 2004”))

but I can’t getting it working for multiple months :confused:


Fiona :uk: (BOB member since 2002-12-16)

Hi,
What if you try something like this :

=Sum( Where ( = “Jan 2004”)) + Sum( Where ( = “Feb 2004”))

Akshay


akshay :india: (BOB member since 2004-02-05)

Thanks XXX


Fiona :uk: (BOB member since 2002-12-16)

did that work?

Akshay


akshay :india: (BOB member since 2004-02-05)