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

Field selection using two criteria: one simple and one complex

I have a table with year, people ID, and a column that says if he/she is retired or not.

People retired is acumulated every year. So at 2020, the table shows people retired during 2018, 2019 and 2020.

I want to show, per year, only the ID of new people retired, excluding people retired during previous years. I attach an excel sheet with the original table, the filter I need an the final answer desired.

Thanks.

Labels (1)
1 Solution

Accepted Solutions
NZFei
Partner - Specialist
Partner - Specialist

Dim1: Year

Dim2: ID_persona

Expression:

if(Year=min({<Retired={"Yes"}>}total <ID_persona> Year),
'Yes'
)

View solution in original post

4 Replies
MarcoWedel

Derive the retired year as separate field in the script and use this year as dimension
MarcoWedel

e. g. like

Left Join (tabPeople)
LOAD ID_persona,
Min(Year) as RetiredYear
Resident tabPeople
Where Retired = 'Yes'
Group By ID_persona ;
NZFei
Partner - Specialist
Partner - Specialist

Dim1: Year

Dim2: ID_persona

Expression:

if(Year=min({<Retired={"Yes"}>}total <ID_persona> Year),
'Yes'
)

MarcosSanz
Contributor
Contributor
Author

Thank you very much. It works!

Now I have to understand better how 🙂