I have a data set that gives me all 'electric charge' transactions in a particular month. From the data, we can see when a charge is initiated, when a charge is complete, and when a charge is unplugged (ended). I am trying to figure out how much in penalties we would have accrued if we implemented idle fees at $2 an hour. All of my variables are at the top of the sheet.
Once the charge is complete, we would give people a variable, say 30 minutes, to unplug their charge. (So anything with less than 30 minutes of idle time does not incur a fee.) Here's where things get more difficult - we don't want people to pay a fee when their charge completes overnight. This "grace period" will be a variable, and we have it set from 10pm to 7am. Therefore, anything that's charge is completed and unplugged between these hours will not incur a fee. If the charge completes overnight, but they don't unplug until 10am, then they would incur 3 hours of idle time (10am-7am). However, if a charge completes anytime before 10pm, that person will be charged until they unplug.
Can someone help me with this? Here a sample of my workbook.
Once the charge is complete, we would give people a variable, say 30 minutes, to unplug their charge. (So anything with less than 30 minutes of idle time does not incur a fee.) Here's where things get more difficult - we don't want people to pay a fee when their charge completes overnight. This "grace period" will be a variable, and we have it set from 10pm to 7am. Therefore, anything that's charge is completed and unplugged between these hours will not incur a fee. If the charge completes overnight, but they don't unplug until 10am, then they would incur 3 hours of idle time (10am-7am). However, if a charge completes anytime before 10pm, that person will be charged until they unplug.
Can someone help me with this? Here a sample of my workbook.