Search found 6 matches

by Vertica4VK
Fri Mar 06, 2015 2:28 am
Forum: Vertica SQL Functions
Topic: First day of the month function?
Replies: 10
Views: 8112

Re: First day of the month function?

Hello Jim I have similar question - trying to figure out first day of month from a table which has a date column - I have gone through previous posts - but i get below error - i tried dbadmin=> select to_date('my_rpt_mth_dt', 'YYYY-MM-01') from dev_data_monthly ERROR 2005: Invalid input for YYYY: "m...
by Vertica4VK
Thu Aug 28, 2014 12:37 am
Forum: New to Vertica SQL
Topic: How to Group By -Runnig Total for Year to Date in VSQL
Replies: 11
Views: 4882

Re: How to Group By -Runnig Total for Year to Date in VSQL

Hello James Thanks again - perfect :-) One more question - this is not needed now as i acheived from seperate query but just wondering if you can suggest - if same can be achieved in query below using Partition - 1) How do i add any condition in Partition - for eg. - let's say for a customer when i ...
by Vertica4VK
Wed Aug 27, 2014 12:57 am
Forum: New to Vertica SQL
Topic: How to Group By -Runnig Total for Year to Date in VSQL
Replies: 11
Views: 4882

Re: How to Group By -Runnig Total for Year to Date in VSQL

Hello again James With regards to rolling ytd by month - ( ytd_avg2 below )- where you are using PARTITON... it works fine when i tested for just one customer but if my data has mupltiple customers like this (sorry i didn't provided you customer name before in my data example ) rpt_dt supply demand ...
by Vertica4VK
Mon Aug 25, 2014 10:44 pm
Forum: New to Vertica SQL
Topic: How to Group By -Runnig Total for Year to Date in VSQL
Replies: 11
Views: 4882

Re: How to Group By -Runnig Total for Year to Date in VSQL

Perfect - Thanks James...

I noticed i get divide by zero error for some of the calculation - how do i take care of that in this ?

Thanks

VK
by Vertica4VK
Mon Aug 25, 2014 7:20 pm
Forum: New to Vertica SQL
Topic: How to Group By -Runnig Total for Year to Date in VSQL
Replies: 11
Views: 4882

Re: How to Group By -Runnig Total for Year to Date in VSQL

Hello Knicely87 Perfect - the last one ( ytd_avg2) is what i was looking for - Thanks. One more( Please ) - with same data i am looking for Rolling 3/6/9/12 Months avg. so - for report month of 2014-01-01 - my avg will be ( prior 3 months - Jan14+-Dec+Nov13) Rolling 3 Month for report month of 2014-...
by Vertica4VK
Sat Aug 23, 2014 2:34 am
Forum: New to Vertica SQL
Topic: How to Group By -Runnig Total for Year to Date in VSQL
Replies: 11
Views: 4882

How to Group By -Runnig Total for Year to Date in VSQL

Hello I need help with Calaculating Year to date running total using VSQL I have data like this rpt_Dt( 01/01/2014) demand = 5 supply = 10 Jan-Avg= 10/5 = 2 YTD-avg-upto-Jan = 2 rpt_Dt( 02/01/2014) demand = 2 supply = 10 Feb-Avg= 10/2 = 5 YTD-avg-From Jan-to-Feb = (Total of Jan+Feb-Supply)= 20 / ( T...

Go to advanced search