Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Cloud Quests

Elevate your workflow skills by solving real-world challenges using the Alteryx Analytics Cloud Platform.

Cloud Quest #21: Quarterly Profit Margins

AYXAcademy
Alteryx
Alteryx

Hi Community,

 

We posted the solution JSON file to Cloud Quest #20. Check it out and let us know what you think! Send suggestions to academy@alteryx.com or leave a comment below!

 

Let’s dive into this week's quest!

 

  1. Download the provided JSON file containing your starting data and workflow files.
  2. Upload the provided Cloud Quest 21 Start.json file into your Analytics Cloud library.
  3. All necessary datasets are contained within Text Input tools in the workflow.

 

For more detailed instructions on how to import and export Designer Cloud workflow files, check out the pinned article Cloud Quest Submission Process Update.

 

Scenario:

 

For this week’s Cloud Quest, your task is to create a workflow that identifies the quarter in which your company achieves the highest profit margin with its clients. However, quarters are not defined in the traditional calendar sense. In this case, quarters are based on the length of a customer’s relationship with your company.

 

For example, if Customer A’s first contract started on 4/1/2018, the company defines Q1 for this client as starting on 4/1/2018, Q2 on 7/1/2018, Q5 on 4/1/2019, Q9 on 4/1/2020, and so on.

 

If Customer B’s first contract began on 7/1/2015, then Q1 for them would start on 7/1/2015, Q2 would start on 10/1/2015, etc.

 

Therefore, Q1 for Customer A begins 4/1/2018, and Q1 for Customer B begins 7/1/2015, even though these dates are years apart and occur at different times of the year.

 

Your objective is to determine which quarter has the highest profit margin for your clients. If you need assistance with the cost and revenue calculations, a hint is provided.

 

  • All contract data contained in the Contracts Input Data tool start on either 1/1, 4/1, 7/1, or 10/1.
  • Cost data is contained in the Cost Input Data Tool.

 

Hint: To calculate the profit percentage, you need to find the total revenue and total costs for each client during that quarter. For example, the quarterly profit percentage for Q5 includes all revenue and costs for every client during their fifth quarter with your company.

 

Important Formulas to Know:

Cost = Order Volume * Per Unit Production Cost

Revenue = Quarterly Premium + (Per Unit Fee for Customers * Order Volume)

Quarterly Profit Margin = (Total Quarterly Revenue – Total Quarterly Cost) / Total Quarterly Revenue

 

Note: We have noticed some unpredictable behavior in Designer Cloud when using the Round() function. Your Margin Percentage result may appear slightly different from the solution output.

 

 

Spoiler

A combination of the Summarize, Join, DateTime, Parse, and various Preparation tools should solve your problem, but not necessarily in this sequence.

 

 

If you find yourself struggling with any of the tasks, feel free to explore these interactive lessons in Alteryx Academy for guidance:

 

Once you have completed your quest, go back to your Analytics Cloud library.

  • Download your workflow solution file.
  • Include your JSON file and a screenshot of your workflow as attachments to your comment.

 

Here’s to a successful quest!

 

Academy Wordmark.png

8 REPLIES 8
JeffF
Alteryx
Alteryx
Spoiler
CloudQuest21_JeffF.png
AkimasaKajitani
17 - Castor
17 - Castor

My solution!

 

Spoiler
image.png
Qiu
21 - Polaris
21 - Polaris

I believe the Group Function in RecordID tool is newly added. I like it.

Spoiler
Cloud Quest 21.png
patrick_digan
17 - Castor
17 - Castor
Spoiler
image.png
alexnajm
17 - Castor
17 - Castor

Done!

Spoiler
quest 21.png
ggruccio
ACE Emeritus
ACE Emeritus

Fun challenge!!!  I may have found the easy way to do it...

 

Spoiler
...multi row formula by quarter

Screenshot 2024-11-18 125920.png
RWvanLeeuwen
11 - Bolide
Spoiler
cloud 21 RWvL.png
geoff_zath
Alteryx
Alteryx
Spoiler
quest_21_workflow.png