Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arpitkharkia
Creator III
Creator III

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!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

try like:

Load

          Memo,

          AutoNumber(RecNo(), Memo) as Flag,

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

From <>;

View solution in original post

4 Replies
tresesco
MVP
MVP

try like:

Load

          Memo,

          AutoNumber(RecNo(), Memo) as Flag,

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

From <>;

arpitkharkia
Creator III
Creator III
Author

It is working just fine.

Thanks for the fast reply!

Kushal_Chawda

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
Creator III
Creator III
Author

This solution is also working.

Thanks for the response!