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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Vince_CH
Creator III
Creator III

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)')

11.jpg

0 Replies