COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: S_N_Solution on 03 Aug 2009 01:33:50 AM

Title: How to print Total after every 10 Rows
Post by: S_N_Solution on 03 Aug 2009 01:33:50 AM
Hi All,

I have req to design a report in which i have to print the TOTAL of measure after every 10 Depts or every 10 rows.For eg:

Row No   Dept No  Sales
   
1   101   11
2   102   22
3   103   33
4   104   44
5   105   55
6   106   66
7   107   77
8   108   88
9   109   99
10   110   100
Total      110
11      
12      
…..      
……      
      
20      
Total      
Title: Re: How to print Total after every 10 Rows
Post by: karun218 on 03 Aug 2009 04:51:35 AM
Hi ,

Please follow the below procedure

1) create Data item called running count and write the following expression inside that

  "ceil((running-count([Deptno])/10))"

2) you will get the output as below

rownum  Deptno   Sales   running-count
-------- ------- ------  ---------------
1           101        10           1
2           102        20           1
3           103        30            1
4           105        10            1
5
6
7
8
9
10
11         107       10              2

3) Now you can group on running-count column and then select measure column in our example "Sales" apply total for that

Now you will get the total based on running-count  column

please try this one...

Regards,
Karun
Title: Re: How to print Total after every 10 Rows
Post by: S_N_Solution on 04 Aug 2009 11:16:16 PM
Thanks a lot Karun....It's working  :D