Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
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
Gysbert_Wassenaar

Can you post a file with example source data and a file with the result data you expect?


talk is cheap, supply exceeds demand
marcus_sommer

Pseudo-code isn't really helpful. Qlikview works (very well) with fields and tables and not with arrays although fields and tables could be considered as arrays in some way. I think you should provide a small example with a few inline-datas and a better description what do you want to do.

- Marcus

sagarrahul
Creator
Creator
Author

can u xplain it more

sagarrahul
Creator
Creator
Author

i want this

hiii there was query i have two data that is covernote number and pol_issue_date

as we see pol_issue_date are in not order .

COVERNOTE_NUMBERPOL_ISSUE_DATE
230215871531-Jul-2014
230215871711-Aug-2014
230215872207-Aug-2014
230215872415-Aug-2014
230215872612-Oct-2014
230215872712-Oct-2014
230215873125-Jul-2014
230215873328-Jul-2014
230215873611-Aug-2014
230215874230-Jul-2014
230215874616-Sep-2014
230215874711-Aug-2014
230215875331-Jul-2014
230215875531-Jul-2014
2302158758
31-Jul-2014

i want i should get dis output when dates are not in proper order or ascending order   .

all the data . i have three yr data and some covernote number .

13-14

14-15

15-16

COVERNOTE_NUMBERPOL_ISSUE_DATE

31-Jul-2014
230215871711-Aug-2014

07-Aug-2014

it can be done by sort -- ascending bt n

marcus_sommer

You could sort your data within a resident load, maybe in this way:

Source:

Load COVERNOTE_NUMBER, POL_ISSUE_DATE From YourSource;

Sorted:

Noconcatenate Load COVERNOTE_NUMBER, POL_ISSUE_DATE Resident Source Order by POL_ISSUE_DATE;

drop table Source;

- Marcus

sagarrahul
Creator
Creator
Author

how will i get this order if date is not in the order .

COVERNOTE_NUMBERPOL_ISSUE_DATE

31-Jul-2014
230215871711-Aug-2014

07-Aug-2014
marcus_sommer

What speaks against the sorting?

sagarrahul
Creator
Creator
Author

i have two things covernote_num and pol_issue_date

let dis b table from this i want following things

if date is not in order then it should get me pre and post date along with its covernote_number

COVERNOTE_NUMBERPOL_ISSUE_DATE
230216870116-Oct-2014
230216871529-Nov-2014
230216871728-Nov-2014
230216871826-Nov-2014
230216872028-Nov-2014
230216872123-Sep-2014
230216872424-Sep-2014
230216873310-Oct-2014
230216875819-Nov-2014
230216875912-Nov-2014
230216876318-Oct-2014
230216876818-Oct-2014
230216877026-Oct-2014
230216877228-Oct-2014
230216877628-Oct-2014
230216877726-Oct-2014
230216878120-Dec-2014
230216878320-Dec-2014
230216879326-Oct-2014
230216879727-Nov-2014
230216879828-Nov-2014
230216881210-Nov-2014
230216882218-Nov-2014
230216884221-Nov-2014
230216884426-Nov-2014
230216886104-Dec-2014
230216889601-Dec-2014
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
230216895804-Oct-2014
230216897129-Sep-2014
230216897307-Oct-2014
230216897909-Dec-2014
230216900120-Sep-2014
230216900827-Sep-2014
230216901207-Oct-2014
230216901427-Sep-2014
230216902621-Oct-2014
230216905530-Oct-2014
230216906211-Oct-2014
230216906314-Oct-2014

this should be the output for all tables that i want u jst help in dis i wil rest of its

COVERNOTE_NUMBERPOL_ISSUE_DATE
16-Oct-2014
230216871529-Nov-2014
230216871728-Nov-2014
230216871826-Nov-2014
28-Nov-2014
230216872123-Sep-2014
marcus_sommer

Sorry, I don't understand what do you want to do and where your problems are.

- Marcus