I show a way to transform the starting table to have only one “X” per row.
I ask for comments on how to do the various steps differently and / or better.
For example how to insert an “index” column or how to filter the rows that contain “X”, or other like the general setting of the solution.
df
7×7 DataFrame
Row │ Name Date Hours Criteria 1 Criteria 2 Criteria 3 Criteria 4
│ String String Int64 String? String? String? String?
─────┼────────────────────────────────────────────────────────────────────────────
1 │ Sander 1/1/2022 8 X missing missing missing
2 │ Sander 1/2/2022 5 missing X X missing
3 │ Sander 1/3/2022 7 missing missing X missing
4 │ Sander 1/4/2022 8 missing missing missing X
5 │ Somebody 2/3/2022 4 X X missing X
6 │ Somebody 4/3/2022 9 X missing X X
7 │ Somebody 5/14/2022 2 missing missing X missing
sdf=stack(df, r"Criteria")
insertcols!(sdf, 1, :Row => 1:nrow(sdf))
udf=unstack(sdf)
filter(r-> any("X" .=== values(r)) , udf)
PS
Is it possible, in some way, to upload csv files?