COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: yogeswari on 28 May 2013 10:14:28 AM

Title: Calculation
Post by: yogeswari on 28 May 2013 10:14:28 AM
Hi,

my requirement is like this.
Data          ID
2004Q1    1
2004Q2    1
2004Q3    1

2004Q4    2
2005Q1    2
2005Q2    2

How to achieve like this.

FYI: Data column is sample values.

thanks,
yogeswari.
Title: Re: Calculation
Post by: RKMI on 28 May 2013 11:22:51 AM
Can you be more clear... no clue, what you are trying do? Why is the topic name calculation? Are trying to calculate some inbuilt function.

Thanks,
RK
Title: Re: Calculation
Post by: yogeswari on 29 May 2013 01:25:50 AM
First of all, Thanks for your reply

Actually my requirement is to display 3 quaters in a page.  To achieve that it is possible to do PAGE BREAK.

So i need one calculated column which should have similar values so that page break with that calculated column is possible to do so.


Any sugestions on this.  Please help me on this as i am searching for past 1 week :( :( :( :(

thanks,
yogeswari.
Title: Re: Calculation
Post by: Lynn on 29 May 2013 08:06:28 AM
If you have a relational source you could look into running-count perhaps.
Title: Re: Calculation
Post by: yogeswari on 29 May 2013 10:11:52 AM
Thanks for your response,

running-count function will uniquely displaying numbers for each row
eg:
1
2
3
4
5...


but i need similar values for 3 rows
1
1
1
2
2
2
3
3
3

The range may change to 4 ...

Please give me an idea :) :) :)


thanks,
yogeswari.
Title: Calculation
Post by: Lynn on 29 May 2013 11:08:39 AM
You can divide running total by the desired group number and discard the remainder to use as the basis for your page break.


Sent from my iPhone using Tapatalk
Title: Re: Calculation
Post by: RKMI on 29 May 2013 04:46:59 PM
Hi Yogi,

Try this,

Create a new data item has the expression as mod(running-count([Date]),3)

Then page break on that data item, so based on the number "3", "4" it will keep that in tact and break on the number of months.

Thanks,
RK
Title: Re: Calculation
Post by: yogeswari on 30 May 2013 02:37:08 AM
Thank you so much for all of your responses.

I too tried this logic before, but it will not suite my requirement because i need ONLY 3 rows/quarters has to be displayed in a single page.  (attaching screen shot for your references)

But applying this logic, it will give more than 3 records in a single page.
The series should be
1
1
1
2
2
2
3
3
3
4
4
4.....


Not like this.
0
1
2
0
1
2

Please give me an idea :( :( :( :( Finding very difficult to get.

thanks,
yogeswari.

Title: Re: Calculation
Post by: MFGF on 30 May 2013 05:12:12 AM
How about

ceiling(running-count([Date])/3)

This is the exact approach Lynn suggested yesterday.

Cheers!

MF.
Title: Re: Calculation
Post by: yogeswari on 30 May 2013 06:44:39 AM
Million times thank you for ALL for your responses.

It is working.  Really you are GREAT!!!

Thank you so much :) :) :) :) :) :) :) :) :) :) :) :) :) :)

thanks,
yogeswari.