Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

MarcosSanz
New 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
xufei123
Valued Contributor

Re: Field selection using two criteria: one simple and one complex

Dim1: Year

Dim2: ID_persona

Expression:

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

4 Replies

Re: Field selection using two criteria: one simple and one complex

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

Re: Field selection using two criteria: one simple and one complex

e. g. like

Left Join (tabPeople)
LOAD ID_persona,
Min(Year) as RetiredYear
Resident tabPeople
Where Retired = 'Yes'
Group By ID_persona ;
xufei123
Valued Contributor

Re: Field selection using two criteria: one simple and one complex

Dim1: Year

Dim2: ID_persona

Expression:

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

MarcosSanz
New Contributor

Re: Field selection using two criteria: one simple and one complex

Thank you very much. It works!

Now I have to understand better how 🙂