COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: lorenmario on 26 Mar 2015 06:53:48 AM

Title: ** Urgent help with calculation between date range!!!
Post by: lorenmario on 26 Mar 2015 06:53:48 AM
Hello!
I need a help for a challenge in a report that I am building, a calculation that returns me the date ranges in which a product was in stock.

Ex .: The product in this stock in March 01,02,03, then returned in March 10,11,12,13.
I need to create a calculated column called Periods in stock that show:

01/03 to 03/03, 10/03 to 13/03

See the attached report to better understand, the red column is the need to calculate that.

Someone managed to make a calculation so if you can help me thank you, it is urgent !!!

Thanks ;)


Title: Re: ** Urgent help with calculation between date range!!!
Post by: lorenmario on 26 Mar 2015 01:53:26 PM
up
Title: Re: ** Urgent help with calculation between date range!!!
Post by: BigChris on 27 Mar 2015 02:50:14 AM
That sounds more like something you'd need to do in the database...some like a loop (which Cognos doesn't really do)
Title: Re: ** Urgent help with calculation between date range!!!
Post by: lorenmario on 27 Mar 2015 07:30:17 AM
Hi, thanks for reply!

Anyone else?
Title: Re: ** Urgent help with calculation between date range!!!
Post by: navissar on 28 Mar 2015 11:42:51 PM
Right,
First of all, nobody can answer that without knowing a lot more. You didn't even bother to specify whether you're working on relational or dimensional, what version of Cognos you're using or what's the underlying database, and where do the stock dates come from.
Second, this is obviously more of an SQL question than it is a Cognos question (Assuming relational). Whether you should use an ETL process or a SP as Chris suggested to loop through data or you can use some text aggregation functions (They exist) to do that is entirely dependent on your data source and your resources, and anyway both aren't Cognos functions.
Third, your post is in violation of at least 2 clauses of the forum etiquette. The 5-hour-bump (Really? You waited ALL OF 5 HOURS without getting a reply) and your dismissive manner towards Chris who gave you a sound advice aren't really making anyone particularly interested in lending you a hand.
Title: Re: ** Urgent help with calculation between date range!!!
Post by: lorenmario on 30 Mar 2015 10:22:29 AM
Hi Nimrod Avissar,

I thanked Chris for posting, I asked if anyone else had any suggestions, did not despise the help offered by him.
If I violated any rule of the forum, I apologize, it was not my intention.

The report is relational, I'm using Report Studio 10.2.1, access an SQL database.

Thanks for your help.