If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Running Subtraction

Started by knip, 09 Oct 2012 11:50:26 PM

Previous topic - Next topic

knip

Hi All,
          I have a Total1 which is calculated at run time and Total2 which is also calculated at run time, can you please let me know how can i calculate Total2-Total1 at run time?

bvk.cognoise

Hi Knip,

I am giving answer based on my undersstnading if i am wrong excuse me and please elaborate ur requiremnt.
if you had already calculated that running total for Total1 and Total2 ..then you can directly sustract thease two data items.
>go to query explorer
>click on your query
>then from tool box drag a data item into the query
> then clcik on data items tab drag  these two data item (total2 and total1)
  for eg:Total2-Total1
>then clcik on ok
it will give the result as u expected.

Regards
BVK
Regards
BVK

knip

Hi BVK,
           Thanks for reply, but let me eloborate my requirement
   I have Total1 which is calulated at run time (this total is dependent on the case statement whcih i write and is calcuted), and similarly Total2 is dependent on the othe case statement,
Ex:
key col1 col2
1      I    100 
2      C    50
3      I     200

When i run my report on 1,2,3 my result is I-C 300-50=250 , running total i mean i have grouped by on certain key and summed the result at report level

pricter

In my view you should create two queries
with the same data items
key col1 col2

and joined (outer join) them by using 

[query1][key]=[query2][key]-1
so on the query which is produced by the join you will have
key  col1    query1.col1        query2.col2         difference
1       I              100                         0                  100
2      C               50                       100                 -50
3      I               200                        50                -150