Forum Discussion

SIBEIRABZ's avatar
SIBEIRABZ
New Member
4 years ago
Solved

Need help with comparing row

I need help with comparing two different rows using if else to make a custom colume in query Logic : If "Rate" = EXPORT, E_EXPO, IMPORT or E_IMPO and if "Rate 2" = export and "Rate 1" of the same ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi SIBEIRABZ ,

     

    Here's my solution.

    Sample data

     

    1.Add two conditional columns to return 1 or 0.

     

    2.Add the two columns.

     

    3.Group by like the following.

    Expand it.

     

    4.Add a condintional to get the result.

     

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.