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

Exclude a field if it is equal to itself

I am trying to create a dashboard to report of HR issues

I have it linked to a database that has a lot of historical data. It can be updated at any time and saves all the records.

In my dashboard I have already overcome the problem of dates by telling my code to count the max date ...using the following

=max(MonthEnd(CommonDateMonth))

My problem is that I am counting everything. If an employee is employed they have a flag and if they have resigned they have a flag.

I want my code to be able to read where a 'uniquefield' (Made up of FirstName, LastName, ID_Number) is in both fields .. ie they have been employed and have now resigned then flag it as resigned otherwise they are a current employee.

I have already tried

PreceedingLoad::
Load*
,
If([uniquefield] = [uniquefield]  and CurrentEmployee = 'Resigned' and 'Employee', 'NoLongerEmployed', 'Okay') as Emp
;

//*****************Normal Load **************

Load*

,If([End Date] < Today(), 'Resigned', 'Employee') as CurrentEmployee

//********************* SQL DB**********************

SQL SELECT *
FROM `.......................................`;

but it is not calculating the second part it is just telling me they are all 'Okay'

I hope this is clear.

3 Replies
sunny_talwar

How can CurrentEmployee be Resigned and Employee at the same time in a single row?

,If([uniquefield] = [uniquefield]  and CurrentEmployee = 'Resigned' and 'Employee', 'NoLongerEmployed', 'Okay') as Emp

shonarach
Contributor III
Contributor III
Author

You are correct they are actual on different lines when I look at the straight table

Would there be a way of excluding them if they are on different lines?

sunny_talwar

Would it be possible to share few rows of dummy data to show how your data looks? I am not sure I understand your first condition where you are checking UniqueField = UniqueField. I might be missing something here and would be able to provide a better solution if I have a look at the dummy data with the expected output here