Search found 12 matches

by dazz
Thu Jul 20, 2017 5:58 pm
Forum: New to Vertica SQL
Topic: Earliest date of the latest ID
Replies: 1
Views: 14306

Earliest date of the latest ID

Hi, I am trying to get the earliest start time of the latest plan that the person took. In the following, the latest plan is P1, and the earliest start date of it is 06-Feb-2015 . It should therefore return P1 , 06-Feb-2015 ID Date Plan Bundle 100 03-Jan-2014 P1 12 100 13-Oct-2014 P2 07 100 21-Dec-2...
by dazz
Fri Aug 07, 2015 3:16 pm
Forum: Vertica SQL
Topic: getting additions and removals
Replies: 1
Views: 5685

Re: getting additions and removals

Hi, to simplify what Im trying to do.. I have a script as follows which extracts info for a.FPR_SERV_NO by month. Some months have no data for the FPR_SERV_NO. I want to flag those as removals, and if it is added back, I want to flag it as an addition. Also the first time it is added, I want to flag...
by dazz
Tue Aug 04, 2015 5:47 pm
Forum: Vertica SQL
Topic: getting additions and removals
Replies: 1
Views: 5685

getting additions and removals

Hello! I am trying to determine the most efficient way to find Additions and removals. The key field is fpr_owning_acct_no||FPR_SERV_NO||FPR_PRODUCT_CODE , and I am using Lead and Lag functions to determine if this key was added or removed by month. However I don’t think I am doing it the most effic...
by dazz
Mon Jul 29, 2013 6:37 pm
Forum: Vertica SQL
Topic: selective running total
Replies: 2
Views: 7088

Re: selective running total

Hey! thanks for responding :) I tried it, but it gave the error that.. 'Column F.Call_Type does not exist'. I ended up having to do the following: select FV.* ,sum(FV.Duration) over (w_sub rows between unbounded preceding and current row) as duration_running_local From (select F.* ,CASE WHEN F.Dest_...
by dazz
Mon Jul 29, 2013 3:49 pm
Forum: Vertica SQL
Topic: selective running total
Replies: 2
Views: 7088

selective running total

Hello! The following sql does a running total of 'Duration' for every Charged_MSISDN by month. It does a running total for every 'Call_Type'. However I only want a running total of certain 'Call_Type' with values 'CIN' and 'DIG'. Will appreciate any help. Thanks! select F.* ,CASE WHEN F.Dest_MSISDN_...
by dazz
Fri Jun 08, 2012 4:06 am
Forum: New to Vertica
Topic: Question on 'Left outer join'
Replies: 10
Views: 30284

Re: Question on 'Left outer join'

Hi skwa!

Thanks for all the info on First_value! Its great to see this working the way I wanted it to. (..I didnt even realise you posted this, but just came back to thank you for all the help already given)

Thanks again!
by dazz
Sat Jun 02, 2012 5:09 pm
Forum: New to Vertica
Topic: Question on 'Left outer join'
Replies: 10
Views: 30284

Re: Question on 'Left outer join'

Hi sKwa, Thanks for the information provided, I was able to succesfully test the first_value Analytic Function separately. However I ended up adding the following (to the original sql in the previous thread): inner join (select cpp.owning_acct_no,cpp.serv_no, cpp.product_code ,MAX(cpp.inst_date) as ...

Go to advanced search