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

Cross Tab

Status
Not open for further replies.

cristianivanoff

Technical User
Nov 13, 2006
43
0
0
SE
Hello All!

I have a table with these fields: {Period},{Paym},{Prodcode}

My cross tab:

Period1|Period2|Period3 etc
Prodcode1
Prodcode2
..
..
In the summarized fields I have the sum of {Paym}.

In period3 I want to show the result of [period3+period(3-1)+period(3-2)]/3. The same goes for period2 and all other periods.

Any suggestions how to solve this?


 
I want to assist with this question, but I'm not sure what you're trying to achieve. Can you reply back with sample data of what you have now and a mock up of the results you're trying to achieve with the sample data.

 
If you are trying to show cumulative averages across periods, then I think you're better off creating a manual crosstab. Insert a group on {table.prodcode} and then create a separate formula per period like this:

//{@period1}:
if {table.period} = 1 then {table.amt}

//{@period2}:
if {table.period} = 2 then {table.amt} //etc.

Place these in the detail section and right click and insert summaries on them at the prodcode group level. Then suppress the group header and details section.

For the averages, create formulas like this:

(
sum({@period1},{table.prodcode}) +
sum({@period2},{table.prodcode}) +
sum({@period3},{table.prodcode})
)/3

-LB
 
Thank you. I did a similar solution to your suggestion. It works fine.

//cristian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top