
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
thanks!
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)) ?
