New column in output for each record

Options

I have an Employee table which stores the Name and Salary. I want to run a query to

  1. Calculate the average salary of the entire table.
  2. Check each Employee's salary. Label it as High or Low if it is higher/lower than the average.
  3. Get an output for each Employee's Name, Salary and Status [high or low].

The first step is working, and I can create and use the average salary. I am stuck creating a new column/variable for each Employee to store the Status value.

Comments

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    Hi,

    You can either use eval if you have access to data directly from query or update the query variable but instead of existing path you can create new path and assign a value to it.

  • Himanshu
    Himanshu Member
    Options

    Thanks Pawel. It worked.

    I can get a boolean result if the grade is < average.

    Any way to get a text field with High and Low as the output?

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options

    Directly in eval I don't think so, but certainly you can do this in next steps in a couple of different ways, for example by using replace filter or lambda