Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show only data without duplicate

Employee               WorkID      Status

Adam                            1          Missing

Alex                              2          Approved

LIm                               3          Pending

Raja                              4          Pending

Singh                            5           Approved   

Adam                            6          Missing

Alex                              7          Approved

Lim                               8          Approved

What formula to use. If I want to produce below result. I dont want employee that have more than 1 id:

Employee          WorkID          Status

Lim                      3                    Pending

Raja                     4                    Pending

Singh                    5                   Approved

TQ,

10 Replies
SunilChauhan
Champion II
Champion II

dimension

Employee

status

expression --> if(Count( distinct  WorkID  )=1,Count( distinct  WorkID  ))

hope this helps

Sunil Chauhan
PrashantSangle

Hi,

Use like this,

Dimension,

Employee:

expression :

if(Count(WorkID)=1, WorkID)

and check Supress null value.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi,

May be try like this below,

if( workid=1, aggr(count(distinct Workid) , Employee)

Anonymous
Not applicable
Author

Hi

 

1:

load * inline
[
Employee,WorkID,Status
Adam,1,Missing
Alex,2,Approved
Lim,3,Pending
Raja,4,Pending
Singh,5,Approved
Adam,6,Missing
Alex,7,Approved
Lim,8,Approved
]
;
inner join
load Count(WorkID) as c,Employee
Resident 1 Group by Employee;

 


2:

Load *,'i' as k
Resident 1 where c=1;

drop table 1;
drop Field k;

use this..

HTH

Ravi N.

kamalqlik
Partner - Specialist
Partner - Specialist

Hi Ahmad,

Please Find attached QVW for your refrence.

Regards

Kamal Naithani

Anonymous
Not applicable
Author

Hi, can you just copy the code here?Tq

its_anandrjs

Hi,

Without affecting the source table you can try with the below load script

Tab1:

LOAD * INLINE [

    Employee, WorkID, Status

    Adam, 1, Missing

    Alex, 2, Approved

    LIm, 3, Pending

    Raja, 4, Pending

    Singh, 5, Approved

    Adam, 6, Missing

    Alex, 7, Approved

    Lim, 8, Approved

];

IdCount:

LOAD

Employee,

Status as NewStatus,

Count(WorkID) as CountWork

Resident Tab1

Group By Employee,Status;

NoConcatenate

New:

LOAD

Employee,

NewStatus,

CountWork

Resident IdCount

Where CountWork = 1;

DROP Table IdCount;

Left Join

LOAD

Employee, WorkID as NewWorkid

Resident Tab1;

And then in a chart plot

Employee,NewWorkid,NewStatus

Or in the front end you can try with as calculated dimension

=if(Aggr(Count(WorkID)=1, Employee), Employee) //and suppress when value is null selected

kamalqlik
Partner - Specialist
Partner - Specialist

Hi Ahmad,

EmployeeTable:

load * inline

[

Employee,WorkID,Status

Adam,1,Missing

Alex,2,Approved

Llm,3,Pending

Raja,4,Pending

Singh,5,Approved

Adam,6,Missing

Alex,7,Approved

Lim,8,Approved

];

Inner Join

Employee1:

load if(count(DISTINCT WorkID)=1,count(distinct WorkID)) as newworkid,Employee

Resident EmployeeTable Group by Employee

;

Employee2:

load *,

'TestEmployee' as flag

Resident EmployeeTable

Where newworkid='1';

DROP Table EmployeeTable;

Regards

Kamal Naithani

Not applicable
Author

hi

take Employee,Status as a dimension and write this expression:

if(Count(DISTINCT Employee)=1,WorkID);