community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Sum query

Highlighted
Meteor

Hi I am looking to do a sum up query on this workflow so I have lots of accounts and a total at the bottom. These have been exported from other systems and imported to alteryx. The colums are shown below, I want to get the debit to add up and match the total figure. Is there a way do do a sum but to not count the first field and last field of a column. 

 

Account

 Debit
BMO (Distribution) 458
CIBC 0
GIC 0
  120177.31
  88645.86
  0
Petty CashAndrea0
Petty CashLiz0
PETTY CASHDavid Vanstone0
addd 0
PETTY CASHValerie Cardinal500
kwa 3910
spare 0
Total 213691.17
Alteryx Certified Partner
Alteryx Certified Partner

Hi @JamesG2806 ,

 

'Is there a way do do a sum but to not count the first field and last field of a column.'

 

I would apply the following logic to remove these records.

 

1. RecordID your dataset.

 

2. Use the sample tool to skip the first 'N' records (n being 1).

 

3. Sort your data in descending order, based on the record ID field.

 

4. Use the sample tool to skip the first 'N' records (n again being 1).

 

Now you have a datastream which excludes both the first and last row; you can now use a summerize tool to consolidate these figures.

 

Ben

Meteor

Worked great thanks 

Labels