7 Replies Latest reply on Sep 17, 2015 5:17 AM by Emily Chen

# window_sum/window_count

I am having a little trouble with window_sum and window_count, and would appreciate examples if anyone has any. I have built a view with the following: 1) INDEX (ranking, top 10), 2) Customer ID 3) Customer first purchase >1 year (either '0' or '1'and is a measure based on purchase date, 4) customerfirst purchase < 1 Year (either '0'or'1'based on purchase date.

I want to be ablt to 1) show a count of the numbers of customers in the window, 2) Count the customers that are in the column 'active < 1 year". Any help is appreciated.

• ###### 1. Re: window_sum/window_count

Hi Jon,

Warm Regards,

Prashant Sharma - India | LinkedIn

• ###### 2. Re: Re: window_sum/window_count

An attached workbook would be helpful, huh.

Here it is.

I have 3 things that I am trying to accomplish that (I believe) should be fairly simple window_ calcs.

1) I would like a count of the Cust IDs in the window

2) I would like a sum of <1Yr (where flagged as either a 0 or a 1

3) I would like a sum of > 1 Yr (where flagged as either a 0 or a 1

Thanks!

Jon

• ###### 3. Re: window_sum/window_count

Hi Jon,

Sorry but can you please share some screenshot of your requirement as I am not clear with your requirement. You want to count the customer but where you want to put the count? & same question for other two problems.

Warm Regards,

Prashant Sharma - India | LinkedIn

• ###### 4. Re: Re: window_sum/window_count

Here is a shot of what is built so far. I need:

a count of cust IDs in the window: in this shot = 11.

a sum of 'active year >1yr, in this case 0

and a sum of 'active year >1yr, in this case11.

placement of these counts/sums isn't that important, as long as they are visible.

Thanks!

• ###### 5. Re: window_sum/window_count

Hi Jon,

Can you pls let us know what have you done to get rid of this problem? I am in a similar situation.

Many thanks

• ###### 6. Re: window_sum/window_count

Hello!

It'll be difficult to count the instances of active year because the years seem to be grouped. Have you given an iif statement a try? something along the lines of iff statement

iif(datediff('day',[SO Period2],today())>365,1,0)

If you let me know which fields are start and end dates, I could give it another go.

• ###### 7. Re: window_sum/window_count

Hello!

Perhaps this might be helpful for you.

iif(datediff('day',[SO Period2],today())>365,1,0)