Alteryx Designer Desktop Discussions

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

formula

LETICIAHELENA
8 - Asteroid

Hello Guys all good?

 

How to create a formula so that my ending balance is my starting balance the next day? 

 

I have just the first day with the inicial balance, for the others day I need complete with my ending day.

 

LETICIAHELENA_0-1680991358789.png

LETICIAHELENA_1-1680991497258.png

 

 

9 REPLIES 9
caltang
17 - Castor
17 - Castor

You can use the Multi-row formula whereby you can use the Ending Balance + 1 as your initial. 

 

There will come a point where your last row will have an Ending Balance of 0, so what you can do is you can use an IF statement like so:

 

IF [Ending Balance + 1] = 0

THEN [Ending Balance]

ELSE [Ending Balance + 1]

ENDIF

 

Hope this helps.

 

Sorry I'm not sure which is your initial / starting, but the concept works above.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
LETICIAHELENA
8 - Asteroid

@caltang thanks and Do you know how can I change the information  "conta Razão" always to the number 1112008 where my spreedsheet is 1114408?

 

I tried this way but didn't work:IF [Conta do Razão]=1114008 THEN [Conta do Razão] =1112008 ELSE [Conta do Razão] endif

LETICIAHELENA_0-1680996783408.png

 

caltang
17 - Castor
17 - Castor

It will be helpful if you can give us the data to work with. 

 

Otherwise your formula seems incorrect...

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
martinding
13 - Pulsar

Hi @LETICIAHELENA,

 

You mentioned that in your spreadsheet it is 1114408, but in your formula, you mentioned 1114008, notice the difference?

 

If that's not causing the problem, then double check your data type for [Conta do Razao], is it a string type or integer type?

LETICIAHELENA
8 - Asteroid

@martinding @caltang  attached the workflow:

 

I want to change the number 1114008 to 1112008.

LETICIAHELENA_0-1681076281955.png

LETICIAHELENA_1-1681076298584.png

 

 

martinding
13 - Pulsar

Hi @LETICIAHELENA,

 

Please save the workflow as yxzp (export workflow), and make sure you tick the input excel sheets.

 

Because yxmd doesn't contain the excel sheets.

 

BUT, based on your formula tool, I can see that it is indeed a string type column and therefore:

1. You should have Quotation Marks " ", as the values are not interpreted as numbers but strings.

2. Another thing is in your THEN clause, you just need to write the value '1112008', rather than [Conta do Razao] = '1112008'.

 

Please update your formula to:

IF [Conta do Razão]='1114008' THEN '1112008' ELSE [Conta do Razão] endif

 

See if this works.

martinding_0-1681078135263.png

 

LETICIAHELENA
8 - Asteroid

Thankssss

LETICIAHELENA
8 - Asteroid

@caltang  Can you help me ?  I tried the way that you said but I need my ending balance to be my starting balance for the next day.

 

I already have the opening balance and ending balance column

 

mas o saldo inicial tem que ser atualizado diariamente com base no saldo final do dia anterior

 

I tried to do it your way but it ended up creating another column and what I wanted was for it to feed my existing column of initial balance, is that possible?

caltang
17 - Castor
17 - Castor

I will be happy to help you. But as @martinding mentioned, you provided a .yxmd file to us. We will need you to export the workflow like this:

 

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Knowledge-Base/Export-Workflows-with-Attac...

 

Once you do so, I will be able to see your data, and provide you with the solution.

 

But if you want to try it yourself, what you need to do is use the Multi-row formula first.

 

Either create a new field or update the field as such:

caltang_0-1681265259409.png

 

From there, you need to write an IF sTATEMENT. 

 

IF the next row is a new day, then get the Ending balance of previous day. If it's not a new day, then get the current ending balance of the current day.

 

That should do it.

 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels