Not applicable
2012-03-20
10:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to generate sequence number per change in a given field?
Hi all,
I have this problem.
I have a logical table in my application.
I want to generate Line_Number(seqNo) for each distinct value of Field "Doc_No".
So for example I want the Line_Number be generated like this:
| Doc_No | Line_Number |
|---|---|
K1000 | 10000 |
| K1000 | 20000 |
| K1000 | 30000 |
K1001 | 10000 |
| K1001 | 20000 |
| K1002 | 10000 |
| K1002 | 20000 |
| K1002 | 30000 |
| K1002 | 40000 |
| K1002 | 50000 |
Thanks in advance,
Kari
3,819 Views
1 Solution
Accepted Solutions
Partner - Master III
2012-03-20
10:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 Replies
Partner - Master III
2012-03-20
10:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi
check the attach file
hope it helps you
Not applicable
2012-03-20
12:40 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
works excellently.
1,234 Views
Not applicable
2012-06-08
05:24 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! Was looking for this too!
1,234 Views
Not applicable
2012-09-28
04:18 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Liron, I am unable to open the TEST.qvw file since I am running personal edition and I am out of recovery keys.
Anyhow hoping that you could post and explain your script here.
Any assistance would be appriciated
Thanks!
1,234 Views
MVP
2012-09-28
04:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try like this
Load *, if(Previous(Doc_No)=Doc_No,numsum(peek('Line_Number'),1),1) As Line_Number from tableName;
Hope it helps
Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Please close the thread by marking correct answer & give likes if you like the post.