I have people's ages ranging from 22 to 69 years of age and I'd like to create a variable to group them from 10 to 10 years (e.g., 20-29; 30-39; etc., or 21-30; 31-40; etc.).

Here's what I did:

- Right-clicked on Age column header;
- Selected Transform;
- In field using transform selected Transform 1 (that already existed);
- Clicked on Edit button;
- There I set the following functions:
- if $source <= 30 use '[21;30] years'
- if $source > 30 use '[31;40] years'
- if $source <= 40 use '[31;40] years'
- if $source > 40 use '[41;50] years'
- if $source <= 50 use '[41;50] years'
- if $source > 50 use '[51;60] years'
- if $source <= 60 use '[51;60] years'
- else use '[61;70] years';

- Clicked on the down arrow in a circle;
- Clicked the up arrow in a circle to hide the setup

The result is that it works if age <= 30, but then everything else is put in the group [31;40] years.

Any ideas on how to get ages above 40 in the correct group?

Thanks in advance for you help.

----

I use Jamovi 1.6.6.0 on macOS Catalina (version 10.15.7), MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports), 2.8 GHz Quad-Core Intel Core i7, 16 GB 2133 MHz LPDDR3, Intel Iris Plus Graphics 655 1536 MB.