You work for a company that is developing a mobile application, or app, for automated same-day deliveries to customers. Customers can use the app to make a delivery, and the app creates a schedule and provisions a carrier from a company storage facility to the customer's doorstep.
When the app receives an update, a user's experience with the app can change. You want to collect user feedback about the updates and pinpoint when a user's sentiment changes to understand whether the update was well-received or poorly-received.
To collect user feedback, you prompt users for their name and the feedback string. The data is added to a relational table each time that a new record arrives.
The following table shows a few sample records that you might receive:
Name
Feedback
‘Saul Steele’
'Best! App! EVER! Thank you so much for this
great app. My life is so much better now'
‘Angela Reyes’
'I learned about this app when I got a flyer
in the mail so I checked it out. It’s user friendly
and there are so many things that I can get delivered. I
never have to go to the store again'
‘Damon Cunningham’
'My family and friends all stand by this app
but every order is late. Last time the delivery finally
arrived and I already left for vacation'
To simplify the data for analysis, you plan to transform the feedback into an identifier that indicates whether the user is satisfied or dissatisfied. The following table shows the transformation from user feedback to user sentiment:
Name
Sentiment
‘Saul Steele’
'satisfied'
‘Angela Reyes’
'satisfied'
‘Damon Cunningham’
'dissatisfied'
Because a user can submit new feedback after each update, you also want to version the data for each user. To ensure that the data is versioned only when the same user sends a new record, you group the data by name.
When the same user sends feedback, the version of their data is incremented by 1. For example, the first time that Saul Steele submits feedback, the version of the data is 1. The second time that Saul submits feedback, the version of the data is 2.
To version the data, you can use stateful variables.