Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count with trick

Hello,

Please help me to add condition, which calculate count base on product type and the latest date. Or may be different algorithm.

Some client switched from one type to other. I should calculate the latest product.

Please see my attached file.

Thanks,

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Create a chart with dimension

=aggr(FirstSortedValue(Product,-[Close Date]), [Account Number])

and as expression

= count(distinct [Account Number])

If you want to group Ent / Pro, I would suggest doing the grouping in the script, creating a new field.

View solution in original post

2 Replies
swuehl
MVP
MVP

Create a chart with dimension

=aggr(FirstSortedValue(Product,-[Close Date]), [Account Number])

and as expression

= count(distinct [Account Number])

If you want to group Ent / Pro, I would suggest doing the grouping in the script, creating a new field.

Anonymous
Not applicable
Author

Thanks, Stefan.

It works for this case.

Thanks again.