Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Seq_No

Hi Friends

I have following data table in my  QV Document except seq No Column. I want to add SeqNo Col with the Seq No on the following basis

Under Each policy No seq No should be allocated to each claim in the order of Loss Date. Kindly help me to do this in my data load script

POLICY_NOCLAIM_NOLOSS_DATECLAIM_PAIDseqNo
1M00154F0000026CL1M004F150000014210318,3001
1M00154F0000026CL1M004F150000024211725,2732
3K00134F0000047CL3K004F140000104197511,5801
3K00134F0000047CL3K004F150000014201029,7222
3K00144F0000098CL3K004F140000144200010,2321
3K00144F0000098CL3K004F150000034211717,1752
3K00144F0000098CL3K004F150000044214942,7503
8M00144F0000101CL8M004F150000014200515,4201
8M00144F0000101CL8M004F150000104208334,0002
8M00144F0000101CL8M004F150000144209921,2603
8M00144F0000101CL8M004F150000244220416,7524
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Make sure your source data is sorted by POLICY_NO and LOSS_DATE. If it isn't the first created a table that reorders the data. Then you can calculate the seqNo field with autonumber(LOSS_DATE, POLICY_NO) as seqNo


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Make sure your source data is sorted by POLICY_NO and LOSS_DATE. If it isn't the first created a table that reorders the data. Then you can calculate the seqNo field with autonumber(LOSS_DATE, POLICY_NO) as seqNo


talk is cheap, supply exceeds demand
marcus_sommer

This could be done with peek() or previous() within a sorted Resident-Load, try something like this:

Load *,

     if(rowno() =1 or peek('POLICY_NO') <> POLICY_NO, 1, seqNo + 1) as seqNo

Resident previousLoad Order by POLICY_NO, LOSS_DATE;

   

- Marcus

avinashelite

Try like this :

1.First sort the table by LOASS_DATE

2.use AUTONUMBER(POLICY_NO,LOASS_DATE) as SeqNo

in the load script this will do

Kushal_Chawda

Create the field as

autonumber(CLAIM_NO,POLICY_NO) as SeqNo


jonathandienst
Partner - Champion III
Partner - Champion III

Please read the other answers before posting an answer that has already been provided.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein