Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for
Did you mean:
Not applicable

## Set analysis - sum condition

How to count the number of licences in newest version?

There are have two tables(below): Versions and Licences of application

Version table

Version.KeyVersionDateInVersionDateOut
12009-10-012010-03-03
22010-03-042011-12-04
32011-12-052012-05-23

Licence table

LicenceVersion.KeySaleDateSaleDateYM
ABC4512009-11-022009-11
ABC2312009-11-252009-11
ABC6512010-01-142010-01
ABC7622010-05-122010-05
ABC9922011-08-232011-08
ABC4332012-01-122012-01

How to obtain the column 3 : Sum all newest licences aggregated in period

SaleDateYMSum of sold in YMSum all licences in newest version
2009-1122 (current ver.key 1)
2010-0113 (current ver.key 1)
2010-0511 (current ver.key 2)
2011-0812 (current ver.key 2)
2012-0111 (current ver.key 3)

Sum of sold is very easy to count but how to obtain  sum all licences in newest version in period ?

4 Replies
Not applicable
Author

Your expression is for column(2) . Column(3) isn't standard aggregation

Not applicable
Author

Hi,

Try using RangeSum function for 3rd column

Best of luck

Not applicable
Author

Hi ,

Attached app is having your output but i'm not sure this approach is perfect way to achieve.

Finally it is having the result as you expected.

Best of luck

Partner - Creator

Hey see am not sure about the answer which i got will suits u or not..

But i got your desired results

The following code worked for me

if(V_Key=1,Rangesum(Above(Total  Count({\$<V_Key={'1'}>}V_Key),0,2)),if(V_Key=2,Rangesum(Above(Total Count({\$<V_Key={'2'}>}V_Key),0,2)),Rangesum(Above(Total Count({\$<V_Key={'3'}>}V_Key),0,2))))

I'd attached the solution below!!

All the best..

Community Browser