Apologies - this is very similar to a query I had earlier but I was unable to delete as I'd made a mistake within it.
I simply want to find the maximum value by group in some of the columns (not all of them) in a dataframe - and reduce this grouped maximum value by one. It will be a single row, not multiple rows that have the maximum value.
So let's say I have a table with the following columns below. I want to reduce the maximum value by group (i.e. Name) in columns A, B and D by one:
Name A B C DBob 3 2 5 5Bob 4 9 7 7 Bob 6 0 1 3 Jim 7 0 7 9 Jim 1 3 9 1Jim 2 7 1 5
The end result I'm looking for is where the maximum value by column (for columns A, B and D) by group is reduced by one, per below - but column C remains untouched. Thanks.
Name A B C DBob 3 2 5 5Bob 4 8 7 6 Bob 5 0 1 3 Jim 6 0 7 8 Jim 1 3 9 1Jim 2 6 1 5