Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
satishqlik
Contributor II

flag

Hi Viewers,

how to create flage for

same employees(emp id) which having different doj

Any help will be appreciated!

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: flag

Ohh, got it. Use Floor() like:

Capture.PNG

t1:

LOAD id,

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

     type

FROM

[modify.xlsx]

(ooxml, embedded labels, table is May);

LOAD id,

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

     type

FROM

[modify.xlsx]

(ooxml, embedded labels, table is Jun);

join

LOAD

id,

Count(DISTINCT doj) as count

Resident t1

Group By id;

final:

LOAD*,

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

Resident t1;

DROP Table t1;

View solution in original post

21 Replies
micheledenardi
Valued Contributor

Re: flag

What is doj ?

Can you give us a better view of your data model/structure ?

Re: flag

You have to explain little more with data

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
satishqlik
Contributor II

Re: flag

Date of joining

Re: flag

Explain with a sample data set

micheledenardi
Valued Contributor

Re: flag

Different "doj" compared to what ?

As loveisfail told, we need more details regarding your table structure.

satishqlik
Contributor II

Re: flag

I have a table with employee id and date of joining

I want to count employee who are having different doj


Let me take


Emp id 1 has two different doj's.


For this I want to create flag


How to accomplish this?

satishqlik
Contributor II

Re: flag

Hi Avinash,

I have a table with employee id and date of joining


I want to count employee who are having different doj

Let me take


Emp id 1 has two different doj's.


For this I want to create flag


How to accomplish this?

satishqlik
Contributor II

Re: flag

I have a table with employee id and date of joining

I want to count employee who are having different doj


Let me take


Emp id 1 has two different doj's.


For this I want to create flag


ultimately I want to count same employees who are having different DOJ.


How to accomplish this?

MVP
MVP

Re: flag

Try like:

Input:

Load

          EmpID,

          DOJ

From <>:

Join

Load

          EmpID,

          Count(Distinct DOJ) as Count

Resident Input Group By EmpID;

Final:

Load

          *,

         If( Count>1, 1,0) as Flag

Resident Input;

Drop Table Input;