Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
andreyfcdk91
New Contributor III

Delete dublicate rows in script

Good day!

In load script i have such table:

Table:

load rowno(),

Id,

Name

from Source...

 

rowno()IdName
11Name1
21Name1
31Name2
42Name1
52Name1
62Name1
72Name1
82Name1

How to delete in load script dublicate rows, where Id and Name have the same value?

I need get such table:

 

rowno()IdName
11Name1
21Name2
32Name1

Thx.

7 Replies

Re: Delete dublicate rows in script

load distinct rowno(),

Id,

Name

from Source...

pavendhan
New Contributor II

Re: Delete dublicate rows in script

The above load script is working as you expected

vardhancse
Valued Contributor II

Re: Delete dublicate rows in script

Yes using distinct we can get only unique numbers

Re: Delete dublicate rows in script

Hi,

Try this,

Tab1:

LOAD Distinct Id & Name as Key,Id,Name;

LOAD * INLINE [

    rowno, Id, Name

    1, 1, Name1

    2, 1, Name1

    3, 1, Name2

    4, 2, Name1

    5, 2, Name1

    6, 2, Name1

    7, 2, Name1

    8, 2, Name1

];

New:

Load RowNo(),Id,Name Resident Tab1;

DROP Table Tab1;

jsingh71
Valued Contributor

Re: Delete dublicate rows in script

Add Distinct keyword before RowNo().

Re: Delete dublicate rows in script

In the question, he mentioned, Where Id and Name have the same value?

Not applicable

Re: Delete dublicate rows in script

Try this.

DEL_DUP:

LOAD

RecNo() as ROW,

ID,

Name;

LOAD

Min(ROW) as ROW,

ID,

Name Group By ID,Name

;

LOAD * INLINE [

    ROW, ID, Name

    1, 1, Name1

    2, 1, Name1

    3, 1, Name2

    4, 2, Name1

    5, 2, Name1

    6, 2, Name1

    7, 2, Name1

    8, 2, Name1

];

Community Browser