Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
alvinford
Contributor III
Contributor III

Hi to Achieve column ID

Hi All,

I have the following data i.e. Call , Number and Name.

Based on the combination of Number and Name, need to derive the ID column.

The Number may have different names associated with it.

if the Number has only one Name the ID should be 1.

if the Number has more than one name the ID should be incremented. Example as highlighted in Blue below.

Please add your suggestions to achieve this.

   

Class Number NameID
1801920170706Sarinya 1
1801920170706Sarinya 1
1840520170607Yuphaporn 1
1840520170607Yuphaporn 1
1840520170607Yuphaporn 1
1840520170607Yuphaporn 1
1840520170607Yuphaporn 1
1840520170607Yuphaporn 1
1840520170607Yuphaporn 1
1850620170918ANGSAYA1
1850620170918CHALUAY 2
1850620170918CHALUAY 2
1850620170918WEERA 3
1850620170918WEERA 3
1854820170815Inta1
1873720170810 Sritutti1
1873720170810 Sritutti1
1873720170810 Sritutti1
1873720170810 Sritutti1
1873720170810 Sritutti1
1873720170810 Sritutti1
1873720170810 Sritutti1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Alisa 1
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Hannah 2
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873820170702Paul 3
1873920170708Gary 1
1873920170708Gary 1
1873920170708Gary 1
1873920170708Gary 1
1873920170708Gary 1
1873920170708Gary 1
1873920170708Gary 1
1873920170708Sreeprasarn2
1873920170708Sreeprasarn2
1873920170708Sreeprasarn2
1873920170708Sreeprasarn2
1873920170708Sreeprasarn2
1873920170708Sreeprasarn2
1873920170708Sreeprasarn2
5 Replies
ogautier62
Specialist II
Specialist II

Hi,

make a sheet with Number, Name in dimension

and ID will be given by rowno()

regards

alvinford
Contributor III
Contributor III
Author

Hi Olivier,

Thank You for your reply. I works fine in the front end.

Want to achieve this in the script. Sorry didn't mention this in my post.

Your help is appreciated.

Thanks You,

Alvin

ogautier62
Specialist II
Specialist II

test:

LOAD  Number,Name FROM   'your file'  ;   

load *, if(peek('Number') <> Number,1, if(peek('Name') <> Name,peek('rang')+1,peek('rang'))) as ID resident test order by Number,Name;

regards

alvinford
Contributor III
Contributor III
Author

Hi Olivier, 


It works perfectly.. thank You ... 

Appreciate your help .. 

will mark it as correct answer .. 

MarcoWedel

Hi,

another solution might be:

LOAD Autonumber(Name, Number) as ID

FROM ...

hope this helps

regards

Marco