Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.

want % of some data on the basis of first record

VinayakS
6 - Meteoroid

Hi Team,
I am having one customer database with their spent on particular medicine from past few years. after some moth or year the medicine prices got changed and each client is having minimum 1 to maximum 1000 price change rows. now I want to calculate % difference of first price with second price changed and then first price with third price changed and then first price with fourth price changed the and so on common point to identify the customer is customer ID each individual customer will have unique ID
If suppose I am having 1 unique id with 5 rows so all the 5 prices will be different and now I want % in all the 5 rows as mentioned above i.e first price with second price changed and then first price with third price changed and then first price with fourth price changed the and so on
also I want to calculate % difference of  last price with second las price changed and then last price with third last price changed and so on

8 REPLIES 8
AdamR_AYX
Alteryx Alumni (Retired)

I'm not sure I completely follow what you are trying to achieve?  Would you be able to provide a small sample of an example input and output?

Adam Riley
https://www.linkedin.com/in/adriley/
VinayakS
6 - Meteoroid

Hi,
Thanks a lot for your message I have shared sample data with you as I am looking for a result motioned in column E and F
It should same result for different group of packs 

Christina_H
14 - Magnetar

I don't follow exactly what you're going for so there might be more efficient ways of doing it, but here's a workflow that will replicate your Excel formulas by identifying the rows you're using in calculations and joining them to every row.

Christina_H_0-1682335901161.png

 

VinayakS
6 - Meteoroid

Hi,
Just wanted to tell you that it is not necessary that 1 record will have 12 rows it can be anything the row count may vary according to the packs attaching sample file for your reference I have shared sample data with you as I am looking for a result metioned in column E and F
It should same result for different group of packs

VinayakS
6 - Meteoroid

Hi,
Thanks a lot for your reply ,
Just wanted to tell you that it is not necessary that 1 record will have 12 rows it can be anything the row count may vary according to the packs, attaching sample file for your reference I am looking for a result mentioned in column E and F it will be a great help if I get the result in same format also In the output I want only those packs whose "percentage (high to low) is greater than or equals to 60"  and "percentage (low to high) is greater than or equals to -60"

Yoshiro_Fujimori
15 - Aurora

Hi @VinayakS ,

 

I tried to follow your request. If there's anything wrong, please point it out.

 

Workflow

Yoshiro_Fujimori_0-1682404006591.png

 

Output Before Filtering

Yoshiro_Fujimori_2-1682404084737.png

 

Output After Filtering

Yoshiro_Fujimori_1-1682404043981.png

 

VinayakS
6 - Meteoroid

Hi,
Thanks a lot for your reply actually after running this workflow on big chunk of data I am not getting the desire output so now sharing sample data with all columns so that it will not have any kind of issue I am looking for a result mentioned in column BZ and CA it will be a great help if I get the result in same format also In the output I want only those packs whose "percentage (high to low) is greater than or equals to 60"  and "percentage (low to high) is greater than or equals to -60" the unique value to get the out put in this data is "Pack Description"

Yoshiro_Fujimori
15 - Aurora

Hi,

From my previous post, you can see how to get the first / last value of each group with Sample tool

Yoshiro_Fujimori_0-1682415032015.png

 

... and how to put it back to the original table with Join Multiple tool.

Yoshiro_Fujimori_1-1682415125464.png

 

So now you should be able to solve your problem.

Good luck.