jenfromjax
Technical User
Let me start by saying that I've seen the other threads on this topic and gather that a SQL Expression is required, which gets inserted into details, then a max summary created (thank you lbass), but that is where I am stuck. I've been looking at this all day so please forgive me if I've left something out or it doesn't make sense. Thanks so much. ~Jen
I'm running Crystal 2008 connected to a view from SQL Server 2008. I need to first calculate the sales region's % sold toward quota, then sort them in decending order based on that %. The report is grouped on {@Region}.
First the formula to calculate %:
IF {@Region Manager Quota} <> 0 THEN
{@TCVTowardQuota RG} / {@Region Manager Quota} * 100
ELSE 0
-----------------------------------------------------------
Formulas referenced above:
//{@Region Manager Quota}
IF {jen_vw_RepAccountActivity.DealRegion} = {@Region} THEN {jen_vw_RepAccountActivity.DealRegionManagerQuota} ELSE
IF {jen_vw_RepAccountActivity.eRegion} = {@Region} THEN {jen_vw_RepAccountActivity.eRegionManagerQuota} ELSE
999999999999
-----------------------------------------------------------
//{@TCVTowardQuota RG}
if ({@Region} in ["New Accounts"])
then Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region})- 4757802.50
else if ({@Region} in ["IBS Eastern"])
then Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region}) + 4451379.50
else if ({@Region} in ["Western"])
then Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region}) + 306423.00
else Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region})
-----------------------------------------------------------
//{@Region}
IF {jen_vw_RepAccountActivity.DealSalesOrg} = FALSE
AND {jen_vw_RepAccountActivity.eSalesOrgID} = FALSE
THEN "Exceptions" ELSE
IF {jen_vw_RepAccountActivity.DealSalesOrg} = True
THEN {jen_vw_RepAccountActivity.DealRegion} ELSE
IF {jen_vw_RepAccountActivity.DealSalesOrg} = FALSE
AND {jen_vw_RepAccountActivity.eRegionID} <> [2, 18, 21, 63]
AND {jen_vw_RepAccountActivity.eSalesOrgID} = True
THEN {jen_vw_RepAccountActivity.eRegion} ELSE
"Exceptions
I'm running Crystal 2008 connected to a view from SQL Server 2008. I need to first calculate the sales region's % sold toward quota, then sort them in decending order based on that %. The report is grouped on {@Region}.
First the formula to calculate %:
IF {@Region Manager Quota} <> 0 THEN
{@TCVTowardQuota RG} / {@Region Manager Quota} * 100
ELSE 0
-----------------------------------------------------------
Formulas referenced above:
//{@Region Manager Quota}
IF {jen_vw_RepAccountActivity.DealRegion} = {@Region} THEN {jen_vw_RepAccountActivity.DealRegionManagerQuota} ELSE
IF {jen_vw_RepAccountActivity.eRegion} = {@Region} THEN {jen_vw_RepAccountActivity.eRegionManagerQuota} ELSE
999999999999
-----------------------------------------------------------
//{@TCVTowardQuota RG}
if ({@Region} in ["New Accounts"])
then Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region})- 4757802.50
else if ({@Region} in ["IBS Eastern"])
then Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region}) + 4451379.50
else if ({@Region} in ["Western"])
then Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region}) + 306423.00
else Sum ({jen_vw_RepAccountActivity.TCVTowardQuota}, {@Region})
-----------------------------------------------------------
//{@Region}
IF {jen_vw_RepAccountActivity.DealSalesOrg} = FALSE
AND {jen_vw_RepAccountActivity.eSalesOrgID} = FALSE
THEN "Exceptions" ELSE
IF {jen_vw_RepAccountActivity.DealSalesOrg} = True
THEN {jen_vw_RepAccountActivity.DealRegion} ELSE
IF {jen_vw_RepAccountActivity.DealSalesOrg} = FALSE
AND {jen_vw_RepAccountActivity.eRegionID} <> [2, 18, 21, 63]
AND {jen_vw_RepAccountActivity.eSalesOrgID} = True
THEN {jen_vw_RepAccountActivity.eRegion} ELSE
"Exceptions