Using CR XI
SQL 2008 DB
I have new report development that includes date range parameters to provide weekly/monthly/yearly reporting.
It includes ONE Group, Plant ID.
Database fields include Production,RapTons, and Shingle Tons that were placed on the detail line and summarized at group and report level.
There is a calculation on the detail line and summary for RapTons + Shingle Tons by plant.
I inserted a calculation for each plant for %All Recycle that is:
if Sum ({PlantDay.TonsProducedTotal}, {PlantDay.PlantID})= 0
then 0
else Sum ({@All Recycle}, {PlantDay.PlantID})/Sum ({PlantDay.TonsProducedTotal}, {PlantDay.PlantID})*100
Plant1 6708.84(ProdwklyTtl) 1673.31 RapTons(wklyTtl) 47 Shingles(wklyTtl) 1720.31 AllRecycle(WklyTtl) 25.64%
Plant2 1833.80(ProdwklyTtl) 441.02 RapTons(wklyTtl) 61.01 Shingles(wklyTtl) 502.03 AllRecycle(WklyTtl) 27.38%
Plant3 390.54(ProdwklyTtl) 71.02RapTons(wklyTtl) 18.02Shingles(wklyTtl) 89.04AllRecycle(WklyTtl) 22.80%
Plant 2 would Rank 1
Plant 1 would Rank 2
Plant 3 would Rank 3
I need to rank the plants based on that %, but it is not available in the group sort options because it is a calculated field.
I looked here for some examples and it seems there may be an option to use a sql expression, but I do not know how to do that...really don't understand how to start this to achieve the results I need at a group level.
If anyone has time to help me to do this and understand why I'm doing what, I would be grateful.
If I need to provide any further information, let me know...and thanks in advance.
SQL 2008 DB
I have new report development that includes date range parameters to provide weekly/monthly/yearly reporting.
It includes ONE Group, Plant ID.
Database fields include Production,RapTons, and Shingle Tons that were placed on the detail line and summarized at group and report level.
There is a calculation on the detail line and summary for RapTons + Shingle Tons by plant.
I inserted a calculation for each plant for %All Recycle that is:
if Sum ({PlantDay.TonsProducedTotal}, {PlantDay.PlantID})= 0
then 0
else Sum ({@All Recycle}, {PlantDay.PlantID})/Sum ({PlantDay.TonsProducedTotal}, {PlantDay.PlantID})*100
Plant1 6708.84(ProdwklyTtl) 1673.31 RapTons(wklyTtl) 47 Shingles(wklyTtl) 1720.31 AllRecycle(WklyTtl) 25.64%
Plant2 1833.80(ProdwklyTtl) 441.02 RapTons(wklyTtl) 61.01 Shingles(wklyTtl) 502.03 AllRecycle(WklyTtl) 27.38%
Plant3 390.54(ProdwklyTtl) 71.02RapTons(wklyTtl) 18.02Shingles(wklyTtl) 89.04AllRecycle(WklyTtl) 22.80%
Plant 2 would Rank 1
Plant 1 would Rank 2
Plant 3 would Rank 3
I need to rank the plants based on that %, but it is not available in the group sort options because it is a calculated field.
I looked here for some examples and it seems there may be an option to use a sql expression, but I do not know how to do that...really don't understand how to start this to achieve the results I need at a group level.
If anyone has time to help me to do this and understand why I'm doing what, I would be grateful.
If I need to provide any further information, let me know...and thanks in advance.