Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting for price comparison

Hi All

I have a QVD file that has client proposals data. Various versions are created based on client feedback. My aim is to find out the discount given starting from base proposal. The data in QVD files is as follows:

QVD1

"Estimate"     "Estimate Copied From"     "Price"      

  X                  -                                       1000        

  Y                  X                                       900        

  Z                  Y                                       800        

  Z11               Z                                       750

Note: No of iterations is not fixed.

QVD2

Sales Order     Estimate

4040               Z11

I want report o/p as follows:

Sales Order    Discount Given

4040               (1000-750) = 250

Any idea how I can achieve this?

Regards

Anu

1 Solution

Accepted Solutions
flipside
Partner - Specialist II
Partner - Specialist II

Hi Anu,

This looks like the Hierarchy feature will work, something like ...

//Hierarchy (NodeID, ParentID, NodeName, [ParentName], [PathSource], [PathName], [PathDelimiter], [Depth])
FinalTable:
Hierarchy (Estimate, Estimate_Copied_from, Price,,,,,'Level') LOAD Distinct Estimate, Estimate_Copied_from, Price
Resident  QVD1;

DROP Tables QVD1;

This generates multiple fields Price1, Price2, Price3 etc to the required depth, with Price1 the top of the hierarchy.  Therefore your Chart expression just needs to be Price1 - Price.

flipside

View solution in original post

3 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi Anu,

Can you please explain little more. Here you are using X value - Z11 value for Z11. Any specific reason ??

flipside
Partner - Specialist II
Partner - Specialist II

Hi Anu,

This looks like the Hierarchy feature will work, something like ...

//Hierarchy (NodeID, ParentID, NodeName, [ParentName], [PathSource], [PathName], [PathDelimiter], [Depth])
FinalTable:
Hierarchy (Estimate, Estimate_Copied_from, Price,,,,,'Level') LOAD Distinct Estimate, Estimate_Copied_from, Price
Resident  QVD1;

DROP Tables QVD1;

This generates multiple fields Price1, Price2, Price3 etc to the required depth, with Price1 the top of the hierarchy.  Therefore your Chart expression just needs to be Price1 - Price.

flipside

Not applicable
Author

Bingo!!! Correct Answer!!

Thanks a ton...