Multiple conditions to multiple columns

cwentz
cwentz Dataiku DSS Core Concepts, Registered Posts: 33 ✭✭✭✭

Hello all!

I have a table that lists the population a student belongs to based on the term. See image.

I want to write a formula that would check the columns for a specific phrase and only keep those rows.

Screen Shot 2021-08-23 at 10.57.55 AM.png

If the column = "First Time Freshman" or "Incoming Transfer" and the next column is blank keep

If the next column is not blank but the third column is blank, keep.

Answers

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,225 Dataiker
    edited July 17

    Hi,

    If I understand correctly and the goal is to keep only certain columns a visual filter recipe with formula is a good choice. If I understood your logic correctly it would could something like this:

    ((column1=="First Time Freshman" || column1== "Incoming Transfer")  && (isBlank(column2) || column2 == '' ))  
    || ((column1=="First Time Freshman" || column1== "Incoming Transfer")  &&  isNonBlank(column2) && (isBlank(column3) || column3 == ''))

    Screenshot 2021-08-23 at 22.27.02.pngScreenshot 2021-08-23 at 22.27.09.pngScreenshot 2021-08-23 at 22.27.23.png

  • cwentz
    cwentz Dataiku DSS Core Concepts, Registered Posts: 33 ✭✭✭✭

    thanks @AlexT
    however, as you can see in the sample data the First-Time Freshman or Incoming Transfer is not always in Col 1. I apologize for not mentioning that. Each Col represents a term for both continuing and new. If the have the First-Time Freshman or Incoming Transfer that term is their first and I want to know if they are still here.

    EX: The second row they began in 15/FA and continued. In the 11th row they began 16/FA but are absent two full terms, yet, returned.

    What I want to capture are the ones that began but don't continue. On average a student would have 8 terms from beginning to end and it would be marked with their beginning population First-Time Freshman or Incoming Transfer and retained thereafter even if 1 or more is blank such as the case in the 11th row.

    Maybe there is a better way to approach the solution. Such as 'if col == First-Time Freshman or Incoming Transfer and the 8th column isnotblank.

    Sorry if I have made it more confusing.

Setup Info
    Tags
      Help me…