Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Vince_CH
Creator III
Creator III

Qlik sense how to look for a first time appeared value in the year by condition

Hi All,

from a list like below, material numbers could be repeated over the years. i want to pick out the new field value first time appeared in this year, say, 2018. i tried with expression like: if(Min(year)='2018', count(DISTINCT ([Material number])), but it doesn't work out, who can give some advices? thanks. 

11.jpg

12 Replies
Vince_CH
Creator III
Creator III
Author

Hi Christophebraul, do you have any further advices here?
Vince_CH
Creator III
Creator III
Author

hello Community, i am stuck with this issue, anyone who can help with this? thanks!
Vince_CH
Creator III
Creator III
Author

Hi, just to conclude here, following are the expressoins for YTD and LYTD new materials occurency counts in KPI settings.

='YTD ' & num(Count(DISTINCT {<Year,Quarter,Month,Week,Date={"$(='>='&Date(AddYears(YearStart(Max(Date),0,7),0), 'YYYY/MM/DD') & '<='&Date(AddYears(Max(Date),0), 'YYYY/MM/DD'))"}>}
(If(Aggr(NODISTINCT Min(Date), Material)=Date, Material))),'#,##0.00K;($#,##0.00)')

&chr(13)&' LYTD ' &
num(Count(DISTINCT{<Year,Quarter,Month,Week,Date={"$(='>='&Date(AddYears(YearStart(Max(Date),0,7),-1), 'YYYY/MM/DD')
& '<='&Date(AddYears(Max(Date),-1), 'YYYY/MM/DD'))"}>}
(If(Aggr(NODISTINCT Min(Date), Material)=Date, Material)))/1000,'#,##0.00K;($#,##0.00)')