Forum Discussion

MRensenSDR's avatar
MRensenSDR
Regular Visitor
5 years ago
Solved

Filter value from column with multiple values

Hi there!   I'm having trouble figuring out how to solve the following problem. I have a table in which I want to filter on a column. The table contain the following: Example: Groupcode V...
  • Anonymous's avatar
    Anonymous
    5 years ago

    If you know in advance about all such cases, you could handle it as follows...

     

    Flavour = 
    VAR CheckOV = SEARCH("OV",FlavourData[Groupcode],1,BLANK())
    VAR Check2 = SEARCH("2",FlavourData[Groupcode],1,BLANK())
    VAR CheckX = SEARCH("X",FlavourData[Groupcode],1,BLANK())
    VAR CheckOH = SEARCH("OH",FlavourData[Groupcode],1,BLANK())
    VAR CheckH = SEARCH("H",FlavourData[Groupcode],1,BLANK())
    VAR Result =
        SWITCH(
            TRUE(),
            NOT(ISBLANK(CheckOV)),"Contains OV",
            NOT(ISBLANK(Check2)),"Contains 2",
            NOT(ISBLANK(CheckX)),"Contains X",
            NOT(ISBLANK(CheckH)) && ISBLANK(CheckOH),"Contains H",
            NOT(ISBLANK(CheckOH)),"Contains OH",
            "Wrong Value"
        )
    RETURN Result

    If you don't know about all such cases, then you have to figure out some other way.