Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prior Month problem

Status
Not open for further replies.

lauriesamh

Technical User
Sep 1, 2004
119
US
I'm quite new to Cognos. My goal is to report "Current Month" (based on a YYYY-MM) parameter and then also report the prior month(and in the case where current month is January,then December of the prior year).

My parameter is based on a Varchar date field YYYY-MM.

I created a current month query that works fine.
I also created a prior month query but had to cast the varchar date to get the prior month to the current parameter.
--------------------------------
if
((cast((substring(?From Date?,6,2)), Integer)-1)<10)
then
(substring(?From Date?,1,5)+'0'+(Cast((cast((substring(?From Date?,6,2)), Integer)-1),CHARACTER)))
else
(substring(?From Date?,1,5)+(Cast((cast((substring(?From Date?,6,2)), Integer)-1),CHARACTER)))
---------------------------------
When I create a union query to combine the data from both to do percentage changes, I only get the current month data and the prior month doesn't pass through. I beleive it is due to the prior month needing the parameter date which it doesn't recognize.

Does anyone have any ideas?

My goal is to have a list with a List with section headers and drop a table within the list section

List section - X Category
Current Month Prior Month % Change
# Clients ### ### ##%
# Employees ### ### ##%
# Ratio Clients/employees ### ### ##%
Average Age of Clients ### ### ##%
% Demographic measure 1 ### ### ##%
% demographic measure 2 ### ### ##%
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top