I need help with a Teradata SQL query

General

I need help with a Teradata SQL query

Good morning!  Hoping that someone can help me with a script.  I need a script to give a weighted service level and can do this with Excel but am stumbling with trying to create a script.  The formula would be sum(sum(Ship_dt - Recd_dt)*Shp_cards)/Sum(shp_cards).  I would need this to be formatted as a decimal 00.00

 

Thanks for any help that you can provide

1 REPLY

Re: I need help with a Teradata SQL query

Hi,

 

How about some sample input data and output results? That might make it easier for people to help you.

 

Doing that may also help to further describe the logic that you need. Your formula contains an aggregation "sum(ship_dt - recd_dt)" which is then divided by  a non-aggregated value "shp_cards" - from the same row?

 

As I said, if you can provide some sample input/output that may help.

 

Cheers,

Dave

 

 

 

 

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com