Skip to content
RED SAGSkills
easy5 pts · first answer countssparkspark-window-functions

Comparing with the previous day's sales

You want each row of daily store sales to also show the sales of the previous day for the same store. Which expression does this?

w = Window.partitionBy("store").orderBy("day")
df.withColumn("prev_sales", ???)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions