Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

arpitkharkia
New Contributor II

Flag duplicate values

Hi all,

I have the following key

Memo
123
124
125
123

I want a flag depending on the occurrence of the record in the field

MemoFlag
1231
1241
1251

123

2

if memo 123 repeats again 3 should come and so on. Finally I want to concatenate Memo and Flag.

Memo Key
1231
1241
1251
1232

Thanks!

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Flag duplicate values

try like:

Load

          Memo,

          AutoNumber(RecNo(), Memo) as Flag,

          Memo & AutoNumber(RecNo(), Memo) as MemoKey

From <>;

4 Replies
Highlighted
MVP
MVP

Re: Flag duplicate values

try like:

Load

          Memo,

          AutoNumber(RecNo(), Memo) as Flag,

          Memo & AutoNumber(RecNo(), Memo) as MemoKey

From <>;

arpitkharkia
New Contributor II

Re: Flag duplicate values

It is working just fine.

Thanks for the fast reply!

Re: Flag duplicate values

another solution

Data:

LOAD Memo

FROM Table;

Final:

noconcatenate

LOAD Memo,

          if(Memo=previous(Memo),peek('Flag')+1,1) as Flag

          Memo & if(Memo=previous(Memo),peek('Flag')+1,1) as MemoKey

Resident Data

order by Memo;

drop table Data;

arpitkharkia
New Contributor II

Re: Flag duplicate values

This solution is also working.

Thanks for the response!

Community Browser