Bennie47250
Programmer
Using Crystal 7.0
This seems like a simple formula but it is not working unless I have included in some fields that seem meaningless. This one has me baffled. This is long so please stay with me.
All of the formulas are in the group footer.
The formula that does not seem to be working correctly is named “$ Performance to Forecast" and is as follows:
if {@2000 YTD Unit Global Declarator} = 0
then 0
else if {@TotalDistYTD$} = 0
then 0
else if {@TotalYTDDistForecast$} = 0
then 0
else {@TotalDistYTD$}%{@TotalYTDDistForecast$}
The {@2000 YTD Unit Global Declarator} formula is:
shared numbervar y2000units;
y2000units:={@Total Curr YTD Units}
The {@TotalDistYTD$} formula is:
{#Dist Sales $ YTD}+{#HD Sales $ YTD}
The {@TotalYTDDistForecast$} formula is:
{@YTDForecastHD$}+{@YTD Forecast Distributor $}
The value for {@2000 YTD Unit Global Declarator} is 253
The value for {@TotalDistYTD$} is 1135432
The value for {@TotalYTDDistForecast$} is 1575000
I’m thinking that since {@2000 YTD Unit Global Declarator}, {@TotalDistYTD$} and {@TotalYTDDistForecast$} all are not equal to 0, I should be able to simply use this as the formula {@TotalDistYTD$}%{@TotalYTDDistForecast$}.
However when I do this, the field is blank.
If I write the formula this way
if {@2000 YTD Unit Global Declarator} = 0
then 0
else {@TotalDistYTD$}%{@TotalYTDDistForecast$} I get the correct answer. (72.1%)
It seems to me that for some reason the formula (thinks it) needs the if {@2000 YTD Unit Global Declarator} = 0 then 0 condition.
Can anyone show me the error of my ways?
Thanks
This seems like a simple formula but it is not working unless I have included in some fields that seem meaningless. This one has me baffled. This is long so please stay with me.
All of the formulas are in the group footer.
The formula that does not seem to be working correctly is named “$ Performance to Forecast" and is as follows:
if {@2000 YTD Unit Global Declarator} = 0
then 0
else if {@TotalDistYTD$} = 0
then 0
else if {@TotalYTDDistForecast$} = 0
then 0
else {@TotalDistYTD$}%{@TotalYTDDistForecast$}
The {@2000 YTD Unit Global Declarator} formula is:
shared numbervar y2000units;
y2000units:={@Total Curr YTD Units}
The {@TotalDistYTD$} formula is:
{#Dist Sales $ YTD}+{#HD Sales $ YTD}
The {@TotalYTDDistForecast$} formula is:
{@YTDForecastHD$}+{@YTD Forecast Distributor $}
The value for {@2000 YTD Unit Global Declarator} is 253
The value for {@TotalDistYTD$} is 1135432
The value for {@TotalYTDDistForecast$} is 1575000
I’m thinking that since {@2000 YTD Unit Global Declarator}, {@TotalDistYTD$} and {@TotalYTDDistForecast$} all are not equal to 0, I should be able to simply use this as the formula {@TotalDistYTD$}%{@TotalYTDDistForecast$}.
However when I do this, the field is blank.
If I write the formula this way
if {@2000 YTD Unit Global Declarator} = 0
then 0
else {@TotalDistYTD$}%{@TotalYTDDistForecast$} I get the correct answer. (72.1%)
It seems to me that for some reason the formula (thinks it) needs the if {@2000 YTD Unit Global Declarator} = 0 then 0 condition.
Can anyone show me the error of my ways?
Thanks