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!

Null values

Status
Not open for further replies.

kuberacupidagra

Programmer
Oct 21, 2005
36
US
Hello All,


I am using CR10 with SAS datasets. I have a report with three groups:

Departments.Dept
Overheads1.Overhead_Type
Overheads1.T_LEAC

I have added "Overhead Dollars" to Group1 and then drilled down successfully to Overhead_type and T_LEAC.

I now wish to add "Overhead Hours" to Group1 in the same report and then want to drill down.

For @Hours_Dec formula in Overhead Hours I was getting an error:
Hours_Dec:
{@ReportYear}:2005
{Overheadlaborhours.Acctg_date}: <null>
{Overheadlaborhours.Hours}: <null>
Var d_strart:#2005-11-25#
Var d_end:#2005-12-31#
Var RptMonth:12

I am checking for nulls and using the following formula:
@Hours_Dec
Local DateVar d_start ;
Local DateVar d_end ;
Local Numbervar RptMonth := 12 ;
// start of fiscal month
d_start := DateSerial ({@ReportYear}, RptMonth , 1-1 ) ;
d_start := d_start - (DayOfWeek(d_start, crFriday) - 1) ;
// end of fiscal month
d_end := DateSerial ({@ReportYear}, RptMonth , 31 ) ;

// select data for fiscal month
if not isnull({OVERHEADLABORHOURS.ACCTG_DATE})
and( {OVERHEADLABORHOURS.ACCTG_DATE}) in ( d_start to d_end ) then ({OVERHEADLABORHOURS.HOURS})
else 0;

I placed the following formula in Group1:
@Hours_Dec_Dept_Sum
Sum ({@Hours_Dec},{DEPARTMENTS.DEPT})

The formulae compiles OK but gives incorrect results for Hours. Also the values for "Overhead Dollars" have changed which were correct earlier. Is this some kind of an overflow problem.

Will look forward for some advice.

Thanks,

AA



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top