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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
tayariib85
Contributor II
Contributor II

How to count new products that are not in previous period (month or week ect...)

Hello everyone, 

 

I have data from Jan 2021 till Dec 2021, and every day there is a new product id created. so my question is how to calculate those new ids for each period. 

For ex:

ProductID total in Jan = 2

ProductID total in Feb=2

tayariib85_0-1663319884216.png

thanks!

Labels (2)
1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

Hi,

create a new field in your datas

left join load

ProductID,

min(Month) as MonMonth

resident YourData;

then

sum(aggr(if(Month=MinMonth,count(ProductID),0),ProductID))

as expression

Regards

View solution in original post

2 Replies
martinpohl
Partner - Master
Partner - Master

Hi,

create a new field in your datas

left join load

ProductID,

min(Month) as MonMonth

resident YourData;

then

sum(aggr(if(Month=MinMonth,count(ProductID),0),ProductID))

as expression

Regards

tayariib85
Contributor II
Contributor II
Author

Thank you it works, the only thing I changed was Count instead of sum.  but what is the logic behind this code:  sum(aggr(if(Month=MinMonth,count(ProductID),0),ProductID)) ?