Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
marcoyukon
Creator
Creator

New Products not in previous periods

What expression would give me the total of new products only ( the product could be on previous periods, but should be NOT be counted )   and total count being dynamically calculated based on year or year+quarter filter selection ?

Data Example:

Yr      Qtr  ProductId
2019 Q1 P1
2019 Q1 P1
2019 Q2 P2
2020 Q1 P3
2020 Q2 P2

results:

2019 selected: 2019 NEW Prod = 2
2020 selected: 2020 New Prod = 1
2020 Q1 selected: New Prod = 1
2020 Q2 selected: New Prod = 0

1 Reply
GaryGiles
Specialist
Specialist

This might need some adjusting, based other selections you might make, but this works for your limited example.

count({$<ProductId=E({1<Yr={"<$(=max(Yr))"}>})>} distinct ProductId)