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

Calculation within groups 1

Status
Not open for further replies.

namitrs

Programmer
Sep 27, 2010
5
US
Hello All

I have a problem with calculation within groups. Here is the sample data -

I have 5 groups (5 days) showing the top 20 sales prices of items for that day.
I would like to get the median and average by each group and show it within the group.
When I do avg(price) or median(price) it shows the median or avg of the entire 100 recs. How can I calculate it by each group?
Kindly help
thread767-676945
 
If you add the group argument to the summaries, do you get the desired values? For example,

average({table.price},{table.groupfield})

-LB
 
Thanks, that helped.
Can you please tell me how could I add a table in a CR. Or how can i add new rows/ cols to a crosstab.
Basically I am trying to have like a crosstab, with the columns being median, avg , stddev etc
and rows being Sales Range1, Sales Range2 etc..
I am kinda new to CR, worked on a lot on BO though.

Thanks for your help
 
If you are using version 9.0 or above in CR, you can insert a crosstab in the report header or report footer, add {table.salesrange} as your row field and then insert the price field multiple times as the field to be summarized, changing the type of summary each time to the desired summaries. Then go to the customize style tab->summary fields->horizontal->show labels. You can then edit the labels if you wish.

-LB
 
I think that is the issues I am facing. Both the cols and rows are part of any table. Like sales range is something I would be putting manually , say 1-20, 21-40 and so on. And in the cols I would be manually putting Median, Avg etc. And for the values I would be putting individual variables.

So in this case what would be best way in your suggestion?
 
I am unclear on what the obstacle is here. Maybe you should show some sample data at the detail level and also show the summary results you expect to see. Be sure to label the fields.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top