Jump to content

Recommended Posts

Posted

Hi community,

I know that is possible, I know that it has been share in a post somewhere few months ago, and I just dont remember how to do it.

On a tabular report, column formating must change depending on the displayed row.

E.g. first row columns must be displayed as /P6C and second row as /P4.2C

Col1 Col2

Row1 1 234 56 874

Row2 5.87 1 345.43

I know that can be done from a DEFINEd field but I cant have to proper syntax.

Not from a variable, this I know.

Thanks

Posted

Im thinking it needs to be a COMPUTE, not a DEFINE. But I guess the COMPUTE could be based on a DEFINE.

DEFINE FILE CAR

PERCENT_OR_DOLLAR/A1 = IF DEALER_COST GT 10000 THEN '$' ELSE '%';

END

TABLE FILE CAR

PRINT

COMPUTE FMT/A8 = IF PERCENT_OR_DOLLAR EQ '%' THEN 'P9.2C%' ELSE 'P9.2M'; NOPRINT

DEALER_COST/FMT AS 'Amount'

BY COUNTRY

END

BY COUNTRY

END

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...