Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gabbar
Specialist
Specialist

use Exclude to filter out

Gabbar_0-1662969533870.png

In this chart i am counting distinct ref_id, But i want that if a reference Id has been counted then it should not be counted again in any upcoming year. The equation of this chart is 

Count({<
DateType={'REf_Id Created On'}
>}distinct REf_Id )

I tried these equation to sort out  
Count({<
DateType={'REf_Id Created On'},REf_Id =e({<DateType={'REf_Id Created On'},DateKey={"<=num(addyears(Max(DateKey),-1))"}>})
>}distinct REf_Id )

and this 

Count({<
DateType={'REf_Id Created On'},REf_Id =e({<DateType={'REf_Id Created On'},DateKey={"<=num(addyears(Max(DateKey),-1))"}>}REf_Id )
>}distinct REf_Id )

 

The graph remained same. 

Please Guide. 

Labels (1)
1 Reply
henrikalmen
Specialist
Specialist

I believe you need to solve this in loadscript, because set expressions only evaluate once per table/chart - not per dimension. I would probably try to create an additional facts table in the data model, where ref_id is only used for the first date occasion it exists on.