Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

Customized button for conditional selection

Hi Community,

From the picture like below, material numbers could be repeated over the years. in KPI I want to pick out the new field value first time appeared in certain period, say, 2018, as well as the counterpart of LYTD, I have wrote the expressions like following which works.

The question is: if to see the counts of first time appeared new materials also in other period, with existing year and month filter selection button, I only can see all materials intead of new materials. so is it possible to create a customized button with condition of year, month, which enable me to see also the counts results of only initial appeared materials in defined period? how can I make this possibly?

='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)))/1000,'#,##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)')