This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.
2022.1.1.30569 Patch Release Update
The 2022.1.1.30569 Patch/Minor release has been removed from the Download Portal due to a missing signature in some of the included files. This causes the files to not be recognized as valid files provided by Alteryx and might trigger warning messages by some 3rd party programs.
If you installed the 2022.1.1.30569 release, we recommend that you reinstall the patch.
A solution to last week’s challenge can be found here.
This week we have a data restructuring challenge regarding equipment maintenance schedules. Imagine that you’ve been tasked with creating an Excel spreadsheet which reports the days on which a truck was in the shop for service. Currently the data are structured such that there are multiple records per truck ID, a date-in value and a date-out value, and a “pattern” variable to indicate on which days the truck was actually being serviced.
A large shipping firm has a fleet of thousands of trucks (though the data for this challenge is provided for only two trucks). The company’s management needs the maintenance history for every truck, placing a 0 or a 1 in the column for every date - beginning at the earliest date in the data and continuing to the latest date – on which the truck was being serviced.
The In-Date and the Out-Date variables indicate the start and end date of the period of time within which the truck was taken off line for service, but not necessarily serviced on each and every day within that span of time. The “Pattern” value indicates which days within the indicated time span that the truck actually received service.
The “Pattern” variable is a string variable in the form of “123.567” or “…456.” or “……7” or any such variation, where the number corresponds to the weekday (with a “1” indicating “Monday” and a “2” indicating a “Tuesday” etc.) and the periods within the pattern indicating a day when the truck was not being serviced. So, for example, if a pattern value is “12.4567” then we know it was in the garage for every day of the week, except for Wednesday. More, a value of “12345..” indicates that the truck had the weekend off.
Hint: This challenge can be solved with and without the use of a macro