We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Adding up data from 2 source: the total cannot be <0

Kingazawora
8 - Asteroid

Hello

 

I have two data sources per customer:

 

1) sales data, where total per customer per month is positive

 

Customer

Total sales per month
A

200

B300
C100

 

2) sales data, where I have sales line items per customer, where data has negative value

 

CustomerSales line items
A-250
B-100
C-90
C-50

 

The rule is: I can add line items to the data no 1 only if the value of added itels is higher than 0 per customer. 

 

So for:

Customer A, I cannot add data from source 2 as the total will be lower than 0

Customer B, I cann add data as total will not be less than 0

Customer C, I can add only the first line item as this will be making the total >0

 

Is there any way to have thnis logic implemented?

 

4 REPLIES 4
sparksun
11 - Bolide

What's the meaning of "add line items to the data"? Could you show your expected output?

JamesCharnley
13 - Pulsar

Hi @Kingazawora 

 

As said above it's not too clear what you'd like but I've taken a stab that involves joining first and filtering out rows based on your condition afterwards, using the multi-row to evaluate rows one at a time when there are multiple.

 

image.png

Kingazawora
8 - Asteroid

When the total for the month (sales data 1) per customer is positive, I can add data from sales from the table 2 but only those that I add and the total of 1 sth table will not be >0.

Kingazawora
8 - Asteroid

Thanks! I have slightly amended.

Labels
Top Solution Authors