Quantcast
Channel: Date - Netezza ---SQL Query
Viewing all articles
Browse latest Browse all 5

Date - Netezza ---SQL Query

$
0
0

Check if order ID is in_business or out of business  -->Logic is nvl(Actual end_date, End date)> Todays date -->then in_business ELSE Out of business.

For IN_Business orders

metric-1 -->1 If start date - todays date(Now()) is <= 90 then '3M'      -->O/P : Count ( orderno) 
metric-2 -->2 If start date - todays date is > 90 &<=365 then '3-12 M'--> O/P : Count ( orderno) 
Metric-3-->3 If start date - todays date is > 365 then '>12M' -->O/P : Count ( orderno) 
Metric-4-->4 if nvl(Actual end_date, End date) - todays date <= 90 days THEN "Leaving soon" -O/P : Count ( orderno) 

Out of business orders

Metric 5 -->5 Check if the nvl(Actual End_date, End date) is > 12 months from today  - O/P : count (orderno)

Metric 6 -->6 Check if the nvl(Actual End_date, End date) is < 12 months from today - O/p: count (orderno)

please provide the case logic for the above 6 metrics


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images