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

Sum columns from column number x to column number (x+n)

ramii
7 - Meteor

Hi, 

    x and n are both numbers and are calculated by me during the workflow. I have two issues:

 

1) How can i store x and n while I am executing my workflow? Also, how do I access these values in maybe a formula tool later in my workflow. As an analogy, I create 2 variables during my program execution, store it and later use it.

2) If I have x as one number and n as another number. Example, x=3 and n=4 then I want to sum the values in columns 3 to 7 (3+4) for every row. 

 

My file has several weeks and the numbers x and n change for every week. So i want the way I sum to be dynamic and be able to decide on runtime as to which columns to sum.

4 REPLIES 4
Inactive User
Not applicable

If you are talking about a single workflow you do not need to store it. Break those variables off into their own stream and append them to datasets where they are required. If we are talking multiple workflows, you can save them to a file or DB; in which those other workflows use that file or DB to then stream in those variables. Appending them to your dataset allows you to then have them at your finger tips for formula tools and other transformations required.

 

The dynamic part is fine, when you run the workflow it picks up the variables in the data and keeps processing. If the variables are a manual entry you can either try making this workflow an analytical app where you type in the variables and update them in the formula tools using an update action or you can have a file that you enter those variables manually and that file is used in the workflows.

ramii
7 - Meteor

It is one workflow but isnt it using too much memory if I store the whole column as just one value. Is there a more memory efficient way to do it?

 

Also, if you can please advice on the other part too. 

Joe_Mako
12 - Quasar

Another tool that may be a good fit for your situation is the append tool. If you your workflow, you crated a single record with two fields (X and Y), you could use that record as the Source (S) to the Append tool, effectively coping those two values to every record in the data stream connected to the Target (T).

 

If you would like to see an example, please create a sample data source or workflow that represents your situation. Thank you!

KaneG
Alteryx Alumni (Retired)

This is also an example of where you can leverage the ability to easily transform data one way for a calc and then back in Alteryx. 

 

If you apply a recordID, transpose the fields in question, then create a FieldNumber Column, you can then 'sum' your columns using a summarise tool.

 

Sum_specified_columns.png

Labels