ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dividing Columns by another column

dkapadia
Átomo

Hi All,

 

Hopefully this makes sense, but I have a workflow that has a bunch of columns that I want to create allocation keys for. I have a set of columns that are broken out by account and another set of columns that have the total for that account. Example below:

 

ProductAccount XAccount YAccount ZAllocation for Account XAllocation for Account YAllocation for Account Z

Product 1

102535

30

6065
Product 215510306065
Product 353020306065

 

What I want to get to is the below in bold. Doesn't have to be overwriting the columns, happy for it to be new columns if that is easier. 

 

ProductAccount XAccount YAccount ZAllocation for Account XAllocation for Account YAllocation for Account Z

Product 1

10253533%42%54%
Product 21551050%8%15%
Product 35302017%50%31%

 

Here is the thing though, there might not always be the same number of columns every time I run it. I have a workflow that takes all existing accounts and sums them up and creates new columns. So there will always be a "Account [letter]" column and an "Allocation for Account [letter]" column. I know I can easily do a formula that just divides 1 by the other, but if for some reason there is a new account or an account that is removed, would like the workflow to keep working.

 

Again, hopefully that makes sense! Thank you so much in advance!

8 RESPUESTAS 8
davidskaife
Magnetar

Hi @dkapadia 

 

Here is my take on it, i've ran on the assumption that the Allocation for each account will always be the total for that account:

 

DavidSkaife_0-1648756210173.png

dkapadia
Átomo

Thank you for the quick reply! That worked perfectly! 

RakshaKumar
Átomo

Hi 
I'm trying to add a formula to divide rate column by tax rate _1. I'm using below formula but alteryx throwing below error can some one suggest 
[RATE] / [Tax Rate_1] 

 

davidskaife
Magnetar

Hi @RakshaKumar 

 

You don't need the quotes around the /

 

[RATE]/[Tax_rate_1] is sufficient

RakshaKumar
Átomo

I tried using the same formula but still throwing error.

RakshaKumar
Átomo

I tried using same formula but still getting error . Pls advise 

davidskaife
Magnetar

Hi @RakshaKumar 

 

Assuming both your inputs are numerical you need to ensure the data type of [Tax Rate] field is also numerical. You currently have it set as a string

RakshaKumar
Átomo

so you mean to say data type should be double? If yes, i tried by selecting double but still same error 

 

Etiquetas
Autores con mayor cantidad de soluciones