title: Otherwise values as option in Pyspark
body: <p>I have the following code:</p>
  <pre><code>session = (spark.table(f'nn_team5_{country}.fact_table')
                .filter(f.col('date_key').between(start,end))
                .filter(f.col('is_client_plus')==1)
                .filter(f.col('source')=='session')
                .filter(f.col('subtype')=='events')
                .groupby('customer_id')
                .agg(f.countDistinct('ga_session_id').alias('total_sessions'))
                .withColumn('session_count',
                           f.when(f.col('total_sessions')&gt;=3,'+3').otherwise('total_sessions'))
               )
  
  display(session)
  </code></pre>
  <p>I have the following output:</p>
  <pre><code>customer_id  sessions  session_count
  484635        2        total_sessions
  483635        40        +3
  484005        1        total_sessions
  484688        3        +3
  184635        4        +3
  
  </code></pre>
  <p>My ideal output would be:</p>
  <pre><code>customer_id  sessions  session_count
  484635        2          2
  483635        40        +3
  484005        1          1
  484688        3         +3
  </code></pre>
  <p>Does someone know how to do it in order to get just the counting in the otherwise part? I used the new column created in the alias but it took it as literal not as the values inside the different cells.</p>
  <p>Thanks!</p>