Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Count based off Aggregate First Sorted Value

I am attempting to use an aggregate function combined with the firstsortedvalue function in order to identify the last Person associated to an ID. This formula successfully tells me the latest name associated to the ID according to date:

=aggr(FirstSortedValue(Name, -Date),ID)

I now want to know the count of the number of times that name has been associated to the ID. I can't figure out what formula to use for this Count column. I tried plugging this value into a set analysis and it only works when you filter for one value for ID, otherwise it's 0.

=count({<Name={$(=FirstSortedValue(Name, -Date))}>}Date)

Original Data:

IDDateName
17/12/2015Sarah
17/13/2015John
17/14/2015John
27/13/2015Sarah
37/12/2015Jim
37/14/2015Sarah

Intended Result:

IDName "=aggr(FirstSortedValue(Name, -Date),ID)"Count

1

John

2
2Sarah1
3Sarah1
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Count based off Aggregate First Sorted Value

Maybe like

=count(aggr(If(Name= FirstSortedValue(TOTAL<ID> Name, -Date), Name),ID,Name,Date))

1 Reply
Highlighted
MVP
MVP

Re: Count based off Aggregate First Sorted Value

Maybe like

=count(aggr(If(Name= FirstSortedValue(TOTAL<ID> Name, -Date), Name),ID,Name,Date))

Community Browser