0
votes

Is it possible to combine 2 values for 1 line/output for a Conditional Column? Below is an example.

Current, 2 Lines:

each if 
[source] = "Source" and [medium] = "Medium" and [medium-2] = "Paid Search" 
or [source] = "Source" and [medium] = "Medium" and [medium-2] = "cpc"
then ="Paid Search"

Desired, 1 Line - Combining both values for "medium-2" into 1 line:

each if
[source] = "Source" and [medium] = "Medium" and [medium-2] = "Paid Search" or "cpc"
then ="Paid Search"

Thanks for the help, Scott

1

1 Answers

0
votes

Logically,

([source] = "Source" and [medium] = "Medium" and [medium-2] = "Paid Search") or
([source] = "Source" and [medium] = "Medium" and [medium-2] = "cpc")

is equivalent to

[source] = "Source" and [medium] = "Medium" and
( [medium-2] = "Paid Search" or [medium-2] = "cpc" )

I.e.

( A && B && C ) || ( A && B && D ) = ( A && B ) && ( C || D )

If the question is more related to syntax, then I'd point out that

[medium-2] = "Paid Search" or [medium-2] = "cpc"

can be rewritten as

List.Contains( { "Paid Search", "cpc" }, [medium-2] )

which isn't much shorter unless you have more than two options.