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.
My approach was to first sort the amounts in descending order to get a quick view of the largest and smallest numbers and if there was any negative figure among the records. Then I used the Select tool to transform the Amount field into a string so I could alter it later with some string formulas. I tried to parse the Amounts into their whole and fractional parts using the decimal point right away, but this proved to be problematic since there were two records showing only integers -with no decimal fraction and therefore without a decimal point. The output for such records was "Null". Given this situation, I opted to use a conditional formula to add ".00" to any record not containing a decimal point. After, I used another Formula tool to create a pair of fields for the length of the whole and the fraction part of the amounts. With the help of a Summarize tool, I could determine the maximum lengths of each of those fields in order to plan enough columns for the final output. Of course, this might be redundant given the fact that a final version of the output is provided within the challenge file and that the whole set consists of only 50 lines. But in case the result is not known a priori and for larger data sets, this information could be quite useful. Then, I used another couple of formulas within the same tool to fill out the missing 0's to the left of the whole and to the right of the fractional amounts so all of them were the same length. One additional formula to get a column with the decimal point. Thanks to a couple of RegEx tool I split the digits of the whole and fraction fields. Finally, I used a Select tool to keep and rearrange the relevant fields and to set their length to 1 character. With a Sort tool, I reset the records to their original order based on their ID.