We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Keeping Track of Price Changes

salemalnahdi14
6 - Meteoroid

Hi, would love 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 of to keep the price changes. When a product is first introduced in the data this the price change will 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!

 

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

This seems to be a duplicate post, refer to the solution posted at https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Creating-a-column-that-keeps-track-of-...

 

Felipe_Ribeir0
16 - Nebula

Hi @salemalnahdi14 

 

One way of doing this

 

Felipe_Ribeir0_0-1669904125491.png

 

Labels
Top Solution Authors