Hi all,
I've got a lot of dataframes which I'm trying to combine. One of the dataframes describe different processes with different codes, like this:
I make the JOIN On the 'ID", which is specifick for one location. But now I want to make a filter. Because the processes are superior to eachother. In the following order: 105 / 115 / 116 / 104. So I only want to see the code from proces 105. But if proces 105 doesn't exicst I only want the code of proces 116.
I tried making a case when clausle in the where:
WHERE (CASE WHEN bls."Loc_type_code" = '105' THEN bls."Loc_type_code"
WHEN bls."Loc_type_code" = '115'THEN bls."Loc_type_code"
WHEN bls."Loc_type_code" = '116' THEN bls."Loc_type_code"
WHEN bls."Loc_type_code" = '104'THEN bls."Loc_type_code"
END)
But then I got an error: Right side of logical expression must evaluate to a boolean (actual: varchar). I hope you can help me :)