Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

IF with multiple Contains

Similar to the below, I'm trying to make an IF statement with Contains but I am trying to count the times 2 (or more) affiliates appear in a customers click path together.   IF CONTAINS WITH MULTIP...
  • tamerj1's avatar
    tamerj1
    3 years ago

    Anonymous 
    Are you looking for something like this?

    FilterMeasure = 
    COUNTROWS ( 
        FILTER ( 
            Orders,
            VAR String = Orders[Path_Taken]
            VAR Items = SUBSTITUTE ( String, " -> ", "|" )
            VAR Length = COALESCE ( PATHLENGTH ( Items ), 1 )
            VAR T = GENERATESERIES ( 1, Length, 1 )
            RETURN
                ISEMPTY ( 
                    EXCEPT ( 
                        VALUES ( Stations[Station] ) ,
                        SELECTCOLUMNS ( T, "@Station", PATHITEM ( Items, [Value] ) )
                    )
                )
        )
    )