Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic Column Variances

r_tripleus
5 - Atom

Hi,

I am creating a workflow to calculate variances for x number of days.

My column name and number of columns will vary based on number of days for analysis and dates used. 

 

Need help or suggestion on how to proceed

 

r_tripleus_0-1622045207812.png

 

6 REPLIES 6
mceleavey
17 - Castor
17 - Castor

Hi @r_tripleus ,

 

Can you post some data and some more information of the variance you want.

Is it daily variance per row? Per total?

 

M.



Bulien

r_tripleus
5 - Atom

Thanks @MC_dup_196 ,

I have attached a sample output.

  • Column headers currently are dates. There could be 2 days or may be up to 5 (dynamic number of columns)
  • Have to cleanse the null values to zero in all the columns
  • Do a day over day variance based on Sec_ID for the number of days

I have been trying to use dynamic & multi field function, but unable to address this.

mceleavey
17 - Castor
17 - Castor

Hi @r_tripleus ,

 

I've built this for you using a bit of transpose and crosstab magic:

 

mceleavey_0-1622051408863.png

 

This pivots the data and creates the variance, then smooshed together the variance and the values and pivots back:

 

mceleavey_1-1622051490256.png

 

Hope this helps.

 

M.

 

 



Bulien

r_tripleus
5 - Atom

Thanks @mceleavey 

My Designer doe not have one tool. May I request you to understand what this tool does in the above workflow.

 

r_tripleus_0-1622052481744.png

 

mceleavey
17 - Castor
17 - Castor

@r_tripleus ,

apologies, that's a tool I wrote. I've attached that now.

 

M

 

ps - if you're on an old version of Alteryx, just open the .yxmc version and save it to your macro folder.

 

 



Bulien

r_tripleus
5 - Atom

Thank you @mceleavey  I got the workflow running

Labels
Top Solution Authors