Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Gowtham174
Creator
Creator

Unique id for duplicate

Hi ALL,

My requirement is below. i need to show 1st Row of team lead as 1 and remaining 0

can i do this in script level?

   

Team LeaderidCount1
a456754651
a456754660
a456754670
a456754680
a456754690
a456754700
a456754710
b456754721
b456754730
b456754740
b456754750
b456754760
b456754770
c456754781
c456754790
d456754800
d456754810

Thanks,

Gowtham

3 Replies
Ivan_Bozov
Luminary
Luminary

How about this:

A:

LOAD * INLINE [

Team,LeaderID

a,45675465

a,45675466

a,45675467

a,45675468

a,45675469

a,45675470

a,45675471

b,45675472

b,45675473

b,45675474

b,45675475

b,45675476

b,45675477

c,45675478

c,45675479

d,45675480

d,45675481

];

B:

LEFT JOIN LOAD

     Team,

     MIN(LeaderID) AS MinID

RESIDENT A

GROUP BY Team;

C:

LOAD

     Team,

     LeaderID,

     IF(LeaderID=MinID, '1', '0') AS Count

RESIDENT A;

DROP TABLE A;

vizmind.eu
jonathandienst
Partner - Champion III
Partner - Champion III

In load script or front end? Define
"first" - load order or some other sort key?

Something like this, perhaps?

LOAD

    [Team Leader],

    id,

    If([Team Leader] = Previous([Team Leader]), 1, 0) as Count1

Resident .....

Order By [Team Leader], id;


Or use the Above() function in a table in the front end.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Ivan_Bozov
Luminary
Luminary

If you question has been answered, please mark the correct response or let us know what is the issue.

vizmind.eu