You needed DO IF, not IF:
DO IF (Ddimero >= Cutoffddimeroforage).
COMPUTE DDimeroAdj=0.
ELSE.
COMPUTE DDimeroAdj=1.
EXECUTE.
Although, with something so simple, you just do:
COMPUTE DDimeroAdj=1.
IF (Ddimero >= Cutoffddimeroforage) DDimeroAdj=0.
This will do the same through the UI:
Transform > Compute Variable...

Press OK. Go back to Transform > Compute Variable...

Then press If...

Then click Continue, then OK.
That should do it.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Fri February 10, 2023 06:31 PM
From: N P
Subject: Crosstabs with condition
Thank you once again, Rick Marcantonio.
As you suggested it may work but I'm making things a bit more complex.
I'd like to generate a var that contains a value according to other two variables (Ddimero and Cutoffddimeroforage) into the dataset.
I tried with syntax but I'm making some mistake, don't know where...
IF (Ddimero >= Cutoffddimeroforage).COMPUTE DDimeroAdj=0.ELSE.COMPUTE DDimeroAdj=1.EXECUTE.
There's a way to make this by UI?
------------------------------
N P
------------------------------
Original Message:
Sent: Fri February 10, 2023 11:40 AM
From: Rick Marcantonio
Subject: Crosstabs with condition
I find it easier to do in syntax. However, you can use the UI:
Transform > Compute Variable...

------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Fri February 10, 2023 11:37 AM
From: N P
Subject: Crosstabs with condition
Hi Rick Marcantonio and thank you for you're really prompt answer.
I ignored the existence of the synxtax function...
Can I create this kind of virtual groups just by the UI or I need to pass by syntax modality?
It looks like way similar to R Studio.
I'll have a look to this new programming language
------------------------------
N P
Original Message:
Sent: Fri February 10, 2023 10:33 AM
From: Rick Marcantonio
Subject: Crosstabs with condition
Hi. Try this.
In syntax:
COMPUTE Group=(My_Variable GE 10).
EXECUTE.
Then in the Crosstabs dialog:

------------------------------
Rick Marcantonio
Quality Assurance
IBM