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: 
satishqlik
Creator II
Creator II

flag

Hi Viewers,

how to create flage for

same employees(emp id) which having different doj

Any help will be appreciated!

21 Replies
avinashelite

Check the sample app attached

micheledenardi
Specialist II
Specialist II

MainTable_tmp:

LOAD EmpID,

     Doj

FROM

[Cartel1.xlsx] (ooxml, embedded labels, table is Foglio1);

left join(MainTable_tmp)

load

  EmpID,

  count( distinct Doj) as NumOfDoj

Resident MainTable_tmp

  group by EmpID;

MainTable:

NoConcatenate

load

  EmpID,

    Doj,

    NumOfDoj,

    if(NumOfDoj>1,1,0) as FlagMultipleDoj

Resident MainTable_tmp;

drop Table MainTable_tmp;

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
satishqlik
Creator II
Creator II
Author

Hi

Thanks for all your suggestions and sorry for my late response.

Still I have been suffering on the same.

I have tried all the ways as you suggested

but still not getting accurate results.

Can you look at my application and suggest where I did wrong?

PFA for your reference!!!

Pls help!!!

satishqlik
Creator II
Creator II
Author

Hi Avinash,

can you look @ my application which I shared in the above!!

avinashelite

Try this script

t1:

LOAD id,

     Date(doj,'DD-MMM-YY') as doj,

     type

FROM

(ooxml, embedded labels, table is May);

LOAD id,

     Date(doj,'DD-MMM-YY') as doj,

     type

FROM

(ooxml, embedded labels, table is Jun);

left join

LOAD

id,

Count(DISTINCT doj) as count

Resident t1

Group By id;

final:

NoConcatenate

LOAD *,

If(count>1,1,0) as flag1

Resident temp;

DROP Table t1;;

satishqlik
Creator II
Creator II
Author

Hi Avinash,

Thanks for your quick response!!

Still facing same problem on count in which we have created with

Count(distinct doj) is giving us non-exact results.

Anymore suggestions???

avinashelite

Count(distinct doj) is giving us non-exact results?

could you explain what your excepting ?

tresesco
MVP
MVP

What is your expected output?

satishqlik
Creator II
Creator II
Author

Yes avinash,

only id 924 is getting accurate result count(Distinct doj) is 2(2 different doj for same id)

But rest of the id's having same doj's so the result should be 1(count for id 85041, it should be 1)

PFA snapshot for your reference!!!

satishqlik
Creator II
Creator II
Author

Hi Tresesco,

Kindly look@ my application

count(distinct doj) is not giving exact result

Please suggest where I did wrong.?