#Pattern matching across two frames

1 messages · Page 1 of 1 (latest)

native topaz
#

I asked the wrong question previously, what I have spent the last few hours experimenting with is as follows.
I am to create a column that takes on the value Gingko or ACET for individuals who were assigned those treatments. Currently the notation of whether or not an individual was assigned those treatments are recorded in two columns as follows.

from an ai I have had this returned

let series =
match column1, column2 withp
| SomeValue1, SomeValue2 -> series1
| SomeValue3, SomeValue4 -> series2
| SomeValue5, SomeValue6 -> series3
| _ -> seriesDefault

https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching

I have also found this.

The problem with using a simple function to match one and then the other is that when doing the match for all of the second ones it replaces all of the returned with nulls. So another solution would be if no match found don't alter anything in any way.

native topaz
#

alternativly I could try a filter but then have the if statement for when adding the second complumn return the new one if it doesn't fin it.