alteryx Community

# Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
###### IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

## Challenge #432: Sequential Logic

Alteryx

Hi Maveryx,

A solution to last week’s challenge can be found here.

Patrick Digan (@patrick_digan)  submitted this challenge that will test your logic skills. Thank you, Patrick, for submitting this great challenge!

You have a dataset that looks like this:

 Record A B C 1 1.0 0.0 0.0 2 1.0 0.0 0.0 3 2.0 1.0 0.0 4 ? ? ?

Your task is to generate rows for records 4 through 25 (1 to 3 will stay the same), and calculate the values of A, B, and C for each row.

The general logic to determine the values in columns A, B, and C for records 4-25 is:

• Column A: Calculate the sum of all numbers in the previous row.
• Column B: Subtract B from A in the previous row.
• Column C: Subtract B and C from A in the previous row.

Hint: You will need to make sure that you calculate the values record by record.

Example for Record 4:

A=2+1+0=3

B=2-1=1

C=2-1-0=1

Example for Record 5:

A=3+1+1=5

B=3-1=2

C=3-1-1=1

Need a refresher? Review the following lessons in Academy to gear up.

Good luck!

17 - Castor

My solution. I think there is an easier solution than mine. But my brain has no idea except this one.

Spoiler

Hmm...It's a bit complex expression!
``````IF [ABC]="::" THEN
ToString(
ToNumber(GetLeft([Row-1:ABC], ":"))+
ToNumber(GetPart([Row-1:ABC], ":",1))+
ToNumber(GetPart([Row-1:ABC], ":",2))
)+":"+
ToString(
ToNumber(GetLeft([Row-1:ABC], ":"))-
ToNumber(GetPart([Row-1:ABC], ":",1))
)+":"+
ToString(
ToNumber(GetLeft([Row-1:ABC], ":"))-
ToNumber(GetPart([Row-1:ABC], ":",1))-
ToNumber(GetPart([Row-1:ABC], ":",2))
)
ELSE [ABC] ​``````

8 - Asteroid

My solution:

Spoiler
Main workflow

Iterative Macro

ACE Emeritus

My first thought was iterative macro!

A bit messy - but works!!!

Spoiler
16 - Nebula
Spoiler
17 - Castor

I'm glad to see this problem made it to the weekly challenges! After you've solved it, here's something interesting:

Spoiler
Did you notice that all 3 columns are the Fibonacci sequence

16 - Nebula
Spoiler

Fibonacci rewritten ...

12 - Quasar

Good one

Spoiler

8 - Asteroid
Spoiler

9 - Comet
Spoiler
Solution Attached