Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sagarrahul
Creator
Creator

how to get pre date and post date

Considerations-

1) covernote Number and Issue Date are coming in-line with Each Other & In Mentioned Sequence.

2) Data Arrives in Ascending Order of Issue_Date

Pseudo-Code

1) Split Issue_Date Column. Capture Month & Date into two Difference Array Variables/Dataset (as Preferred)

date_array1[]= issue_date.split(1)

month_array2[]=issue_date.split(2)

2) Store CovenantNo into another array

covenant_no_array3[]= loop(Covenant Number)

3) Apply Bubble Sort (Quick Sort Can also be done for Faster Results, but Bubble Sort will be easy to identify out of Order Value.)-

a. First on month_array2[] (use as outer loop)

b. Second on date_array1[] (use as inner loop)

4) When out of Order Value found, print that value as Current Value. Pre-Value is index-1 of Current Value. Post Value is index+1 of current value. Covenant number is index of current value,

used in covenant_no array

i.e.

current_value= date_array1

pre_value= date_array1[i-1]

post_value= date_array1[i+1]

covenant_no=covenant_no_array3

how to do it in script and expression

can u help me in dis

11 Replies
Not applicable

HI sagar

you can try this in sorting tab

Sort by expression (Ascending):

=Date#(Day&Month&Year, 'DDMMMYYYY')

sagarrahul
Creator
Creator
Author

ty sir for giving ur time

i m having certain  covernote_number  and pol_issue_date.

as in this table

covernote numberpol_issue_date
230216890418-Nov-2014
230216890518-Nov-2014
230216890818-Nov-2014
230216891019-Nov-2014
230216891520-Nov-2014
230216893120-Nov-2014
230216893411-Nov-2014
230216894021-Nov-2014
230216894522-Nov-2014
230216894622-Nov-2014

sir this date table is in proper ascending order .

bt my problem comes when date i.e. pol_issue_date is not in proper order .

will gv u example : 

COVERNOTE_NUMBERPOL_ISSUE_DATE
230216870116-Oct-2014
230216871529-Nov-2014
230216871728-Nov-2014
230216871826-Nov-2014
230216872028-Nov-2014
230216872119-Nov-2014

sir look at this :

first covernote_number is 2302168701 and its pol_issue date is 16\oct\2014

(in this both covernote_number and pol_issue_date is correct in sequences )

second covernote_number is 2302168715 and its pol_issue date is 29\nov\2014

(in this covernote_number and pol_issue_date is correct as its upper date is of oct month and this date is nov so it correct )

third covernote_number is 2302168707 and its pol_issue date is 28\nov\2014

(in this covernote_number is right and pol_issue_date is not in order date is 28-nov-2014 from above date is bigger that is 29\nov\2014 month )

as


as all the rest are in not order

so i want the output in dis way

all the pol_issue date which are not in order it should through this output as below

COVERNOTE_NUMBERPOL_ISSUE_DATE
29-Nov-2014
230216871728-Nov-2014
26-Nov-2014