How to select categories (based on multiple variables) for the x-axis of a chart

#1
For example:
Lets say I have the following variables:
Variable 1: "Groups". Involves two groups of patients. 1= patients with infection, 2= patients without infection
Variable 2: "Mortality". Subdivides patients with infection in two subgroups. 1= patients who died from infection, 2= patients who survived the infection
Variable 3: "labtest". A numerical scale variable.
Lets say I want to graph the following boxplot.
- Y axis: labtest
- X axis: I want 4 categories. 1) The total group of patients with infection, 2) the subgroup of patients who died from infection, 3) the subgroup of patients who survived the infection and 4) the group of patients without infection.
Using the chart builder I can only select one variable for x-axis. Is there a way to specifically select the group I want for each category in a box plot? Ideally I would like a way to be able to select each category of a chart based on the value of more than one variables.
I could create a new variable with the 4 groups I want. But I would like to know if there is a faster way to do it.
Thank you in advance