Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

FIFO / LIFO For Cost of Goods Sold - forum topic by newb1

$
0
0

Hello,
 
I have to develop a cost of goods sold script using FIFO / LIFO techniques. I have a crude working program that uses volatile tables for stock in and stock out  that runs through each sale and attributes the stock using a  partitioning and row qualifying technique. The script has to be called through a macro for each sale. The problem with the technique is the more sales, the more macro executions are required. This is slow and cumbersome when dealing with large numbers of sales (1000s).
 
I found this example of  FIFO script that uses CTEs that purports to be faster and runs without the need for a macro: http://ask.sqlservercentral.com/questions/1227/the-subscription-list-sql-problem.html
 
Has anyone attempted to adapt it to Teradata SQL. If so, I would really like to know how to go about it.
 

Tags: 
Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>