I got struck here can anybody help me?

Magic ETL Activity

Using the DataSet in Domo you created using Workbench in the previous activity,

1. Use Magic ETL to parse the currency code from the "Transaction Amount" column and separate the amount and the currency code into separate columns.

Submit: A screenshot of the output of the data showing the different columns created.

2. Calculate the average time between orders. For each record in the DataSet, add a field showing the number of days since the previous order for that customer.

Submit: A screenshot of which customer has the longest average time between orders and what is the average number of days?

Best Answer

  • ArborRose
    ArborRose Coach
    Answer ✓

    Sounds interesting. Is this question coming from a school or training exercise?

    • Parsing the Currency Code and Amount:
      • As your screenshot shows, you can use the split column tile toseparate based on a delimiter (space or symbol that separates the code and amount) and then a formula tile to clean up or reformat the separated values.

        Your screenshot shows a regular expression but I don't think Domo supports using regex pattersn in the way shown. The first formula appears to be trying to extract the numeric value followed by a currency code. The second appears to be attempting a regular expression to match three uppercase letters.
    • Calculating Average Time Between Orders:
      • To find the time between orders, you can try using a Rank and Window tile to sort the orders by date.
      • Then, use a date difference formula to calculate the number of days between the current and previous order for the same customer.
      • Once you have those differences, aggregate them with a "Group By" tile to find the average time between orders for each customer.
    • Sorry….I can't get "code block" to work in this post. I can only type. Your regular expressions might be done something like:
    • REGEX(Transaction Amount, '\d+\.\d+')

      REGEX(Transaction Amount, '[A-Z]{3}')

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

Answers

  • ArborRose
    ArborRose Coach
    Answer ✓

    Sounds interesting. Is this question coming from a school or training exercise?

    • Parsing the Currency Code and Amount:
      • As your screenshot shows, you can use the split column tile toseparate based on a delimiter (space or symbol that separates the code and amount) and then a formula tile to clean up or reformat the separated values.

        Your screenshot shows a regular expression but I don't think Domo supports using regex pattersn in the way shown. The first formula appears to be trying to extract the numeric value followed by a currency code. The second appears to be attempting a regular expression to match three uppercase letters.
    • Calculating Average Time Between Orders:
      • To find the time between orders, you can try using a Rank and Window tile to sort the orders by date.
      • Then, use a date difference formula to calculate the number of days between the current and previous order for the same customer.
      • Once you have those differences, aggregate them with a "Group By" tile to find the average time between orders for each customer.
    • Sorry….I can't get "code block" to work in this post. I can only type. Your regular expressions might be done something like:
    • REGEX(Transaction Amount, '\d+\.\d+')

      REGEX(Transaction Amount, '[A-Z]{3}')

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • I got the answer, thanks a lot sir☺️