I have a cross tab built (income statement). My rows are revenue, expenses, revenue per unit, expense per unit, profit, profit per unit, profit %, etc. My columns are years (2007, 2008, 2009, 2008 vs. 2009), etc. I want specific formatting (‘Display String’ option under ‘Format Field’ option) based on what the column is. For my “per unit” and “%” calculations, I’m having to use some code under Display String to get these to show properly for each year (i.e. 2008). But for my difference column (2008 vs. 2009) this does not work and I get the wrong value result. Is there a way to write logic to determine the Display String action based on what my column is? I tried an “If, Then” statement using both the year’s field value and the alias I called the year in the crosstab expert, but the logic does not seem to work. Is there a way to do this? Below is the code I’m using. The else part works for the years but not the difference of years (variance column). Thanks.
//Per Unit
If {ZFI_M50_ZBO_ZFI_M50_Q0001.[D5EHTOYC657IWHX9HIIWDTFTS]} = ‘YTD Act vs. 2008’ or {ZFI_M50_ZBO_ZFI_M50_Q0001.[D5EHTOYC657IWHX9HIIWDTFTS]} = “YTD Actual vs. Exp”
Then
“Test”
Else
(WhilePrintingRecords;
numbervar Sales;
numbervar Units;
if Units <> 0
then totext(Sales / Units,2)
else
‘0.00’)
mikegbuff (BOB member since 2009-05-28)