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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crosstab: Grand Total Based Top N 1

Status
Not open for further replies.

datenis

Programmer
Jan 22, 2002
98
CA
Hi,

I'm using Top N for my Crosstab, and I'd like to sum the column totals based only from the top N rows, instead of all rows, how do I do this?

Thanks.

D
 
Select the inner cells and the row totals->format field->common tab->suppress->x+2 and enter:

whileprintingrecords;
numbervar sumx := sumx + currentfieldvalue;
false

Then select the column totals and grand total->format field->common tab->display string->x+2 and enter:

whileprintingrecords;
numbervar sumx;
totext(sumx,2)//for two decimals

Then with the same column total and grand total fields selected, go to the border tab->color->background->x+2 and enter:

whileprintingrecords;
numbervar sumx := 0;
crNoColor

This method makes use of formatting property formula areas (and the order in which they are processed) that are otherwise irrelevant to the actual purpose.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top