Question: I am trying to do this:

```
.withColumn("System", when($"SysID".split("-").length > 3, $"SysID".split("-").take(3)).otherwise(null))

```

But I get the following error:

error: value split is not a member of org.apache.spark.sql.ColumnName

What can I do to use the split function?

Thank you.

Answer: 
This will select salary in the last row.

```
df['Salary'][-1]

```
You can also use [`take`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.take.html):

```
df['Salary'].take([-1])

```