Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Summarize based on conditional statements

akanksha01
6 - Meteoroid

I have a data set like this, 

ParentRegionFig.1Fig.2TypeClass
A

Germany

45667YR
AIreland098

N

I

BGermany8724NI

B

Ireland980YR
BUK450YI
CUS576YR
CLux090NR

 

Want to create different output based on following conditions. Please note that I cannot use formula tool to define specific region (Germany) or Parent names (A,B,C) as the source data sheet has many of them. These conditions are more or less similar hence even if I get solution for 1 or 2 that will be really helpful.

Condition 1: If Fig.1 for Parent in a region is "0" OR the region is not present in dataset for the Parent then "No Data", else if Fig.1 of Class "R" for a Parent in a region is >= 25% of sum of Fig.1 for that Parent in all regions then "Oppt'y" else "No Oppt'y" EndIf

Expected Output

ParentGermanyUKIrelandLuxUS
AOppt'yNo DataNo DataNo DataNo Data
BNo Oppt'yNo Oppt'yOppt'yNo DataNo Data
CNo DataNo DataNo DataNo DataOppt'y

Condition 2: Condition for "No Data" remains same, else if Fig.2 of Type "Y" for a Parent in a region is >= 10% of sum of Fig.1 for that Parent in all regions then "Oppt'y" else "No Oppt'y" EndIf

Expected Output

ParentGermanyUKIrelandLuxUS
AOppt'yNo DataNo DataNo DataNo Data
BNo Oppt'yNo Oppt'yNo Oppt'yNo DataNo Data
CNo DataNo DataNo DataNo DataOppt'y

Condition 3: Condition for "No Data" remains same, else if Fig.2 for a Parent in a region is Greater than 0 but less than 70 then "Oppt'y" else "No Oppt'y" EndIf

Expected Output

ParentGermanyUKIrelandLuxUS
AOppt'yNo DataNo DataNo DataNo Data
BOppt'yNo Oppt'yNo Oppt'yNo DataNo Data
CNo DataNo DataNo DataNo DataOppt'y

Condition 4: Condition for "No Data" remains same, else if Fig.2 for a Parent in a region is "0" then "Oppt'y" else "No Oppt'y" EndIf

Expected Output

ParentGermanyUKIrelandLuxUS
ANo Oppt'yNo DataNo DataNo DataNo Data
BNo Oppt'yOppt'yOppt'yNo DataNo Data
CNo DataNo DataNo DataNo DataNo Oppt'y

 

Please suggest. 

Thanks in advance

5 REPLIES 5
BenMoss
ACE Emeritus
ACE Emeritus

Hey,

 

I like the challenge.

 

I'll try get something over to you soon but it's clearly going to go beyond just a couple of tools I think.

 

Ben

BenMoss
ACE Emeritus
ACE Emeritus

Hey akanksha01,

 

Here is the solution I came up with.

 

Please walk through it and if you have any questions please reach out!

 

Ben

akanksha01
6 - Meteoroid

Thanks Ben, It worked like a charm :)

 

SeanAdams
17 - Castor
17 - Castor

Hey @akanksha01

 

Also took a bash like @BenMoss - slightly different approach.

 

 

Some things to notice:

- I had 3 inputs - one is your input data; second is a clean list of regions; third is a list of parents.   Reason for doing this is that you may not get a particular parent on any given day, and if you only rely on your input data to spot this you'd miss the fact that this should be reported as "no data"

- In there's an append that joins the two clean lists together.   Technically this is called a Cartesian product - it blows out every combination of region and parent.   This is critical to spot missing combinations

- I didn't redo the "no-data" pieces in each condition - just joined them into the final union for each condition - the connections are marked as "wireless" so you can't see them

- Finally - on each of the conditions - the data arrives as a 3 column table - Parent; region and OpportunityTag.   A quick Cross-tab changes this into the final format you needed.

 

Hopefully this answers your question (along with @BenMoss 's solution you now have two ways to tackle) - if so, could you mark this as solved?   If you have additional questions, feel free to post them here

 

have a good weekend

Sean

akanksha01
6 - Meteoroid

Thanks Sean for this.

You are right, there are cases when a parent region combination was not present in data-set. which may result in No Data. I applied your method as well and only at the cross tab level I had to change method as "First" instead of Concatenate and it resulted in the desired output.

 

Thanks again.

Labels