Alteryx Designer Desktop Discussions

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

Date and price comparison

Pramod91
8 - Asteroid

I need your help again. I have few fields in a dataset like below:-

 

PSDPEDEXF PRICEVN EXF PRICEHOSP PRICEVN HOSP PRICEPPPLaunch DateEXF Less DiscountPPP Less DiscountHOSP Less DiscountSUDRI DATE
15/09/201731/10/2018275.26255.99--284.63-275.26284.63-25/12/2018-
01/10/201731/12/2018275.2255.94--284.57-275.2284.57-02/01/201901/12/2018
01/10/201704/12/2018235.37218.89--243.48-235.37243.48-25/12/201823/11/2019

 

Also, I have a reference file as:-

 

Price1Price2 Date1Date2
EXF PRICEEXF Less Discount SUDPED
EXF Less DiscountVN EXF PRICE PEDPSD
HOSP PRICEHOSP Less Discount PSDRI DATE
HOSP Less DiscountVN HOSP PRICE RI DATELaunch Date
PPPPPP Less Discount   

 

What I want to do is, to check if the Price1 > Price2 and Date1 > Date2 (List of Price and Date is to be considered from the reference file)

 

Also, if Price2 is undefined (-) in data and the same field is used as Price1 on the next row then the original Price1 will be compared with the new Price2. For example, if EXF Less Discount is "-" then EXF PRICE must be greater than or equal to VN EXF PRICE. And the same logic I want to implement for Dates as well.

 

It would be a great help if anyone could suggest some ways to do this.

5 REPLIES 5
Pramod91
8 - Asteroid

Can anyone please help me with this?

messi007
15 - Aurora
15 - Aurora

@Pramod91,

 

Could you share the expected output it will help to understand your need 🙂

 

Best Regards,

Pramod91
8 - Asteroid

Hello @messi007 

 

I will breakdown the problem to a smaller part.

Given the below data:-

 

PSDPEDEXF PRICEVN EXF PRICEHOSP PRICEVN HOSP PRICEPPPLaunch DateEXF Less DiscountPPP Less DiscountHOSP Less DiscountSUDRI DATE
15/09/201731/10/2018275.26280--284.63-275.26284.63-25/12/2018-
01/10/201731/12/2018275.2284--284.57--284.57-02/01/2019-
01/10/201704/12/2018235.37218.89--243.48-235.38243.48-25/12/2018-

 

I just want to check three conditions -

1.Whether the prices follows the hierarchy :- EXF PRICE >= EXF Less Discount Price >= VN EXF PRICE

2. If any one of the price level (EXF PRICE, EXF Less Discount Price, VN EXF PRICE) is not present "-" then the other two price levels should be checked for hierarchy, for example, if EXF Less Discount Price is "-" for any record (here in Row 2) then it should compare if EXF PRICE >= VN EXF PRICE

 

Here, in the given data, all 3 rows should give you a false result in output- 

Price comparePSDPEDEXF PRICEVN EXF PRICEHOSP PRICEVN HOSP PRICEPPPLaunch DateEXF Less DiscountPPP Less DiscountHOSP Less DiscountSUDRI DATE
FALSE15/09/201731/10/2018275.26280--284.63-275.26284.63-25/12/2018-
FALSE01/10/201731/12/2018275.2284--284.57--284.57-02/01/2019-
FALSE01/10/201704/12/2018235.37218.89--243.48-235.38243.48-25/12/2018-

 

I hope this explanation helps.

messi007
15 - Aurora
15 - Aurora

@Pramod91,

 

Please see below:

messi007_0-1608122949973.png

Attached the workflow,

If this solves your issue please mark the answer as correct, it will help others!

 

Regards

Pramod91
8 - Asteroid

Thanks @messi007 

 

It works. But if I have more set of fields for which I need to do this, is repeating all these steps is the only option? Or, is there a way I can give reference of the fields for which I need to implement this and it will repeat the same steps for all fields present in the reference list?

Labels