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

Creating a column that keeps track of price changes

salemalnahdi14
6 - Meteoroid

Hi, would appreciate some help in creating a column to keep track of changes in price and the date it happened.

 

For example, I have this dataset. The column counter is a live counter of the number of times a product is in the dataset and is sorted by date, so earliest date will start with 1 and continue from there:

Product IDDatePriceProduct ID Counter
13/22/2022501
16/27/2022702
18/12/20221003
21/17/2022601
24/14//2022402
32/11/20221101
36/15//20221502
310/18//20221203

 

I would love my output to look like this, an extra column that tracks the changes in price to the previous entry. When a product is first introduced in the data then it will just be the price of the product.

 

Product IDDatePriceProduct ID CounterPrice Changes
13/22/202250150
16/27/202270220
18/12/2022100330
21/17/202260160
24/14//2022402(20)
32/11/20221101110
36/15//2022150240
310/18//20221203(30)

 

I created the product ID counter as I suspect it could be helpful to use in a formula, but not sure how to proceed. Was thinking of using the counter in a statement where:

  • If Product ID Counter = 1, then Price
  • If Product ID Counter>1,then Price - Price where Product ID Counter-1 

The second part of the formula is where I am not sure how to proceed as don't believe there is a "Where" function in the formula tool. Would love some help, thanks!

 

Also open to any other solutions!

3 REPLIES 3
Luke_C
17 - Castor

Hi @salemalnahdi14 

 

You can use a multi-row formula tool grouped by Product ID. No need for if statements:

Luke_C_0-1669903584261.png

 

 

salemalnahdi14
6 - Meteoroid

Thank you, this worked!

Sarreddy
9 - Comet

@salemalnahdi14  My Solution for the requirement.

 

Sarreddy_0-1669904341620.png

 

Labels