Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
sagarrahul
Creator
Creator

date problem

there is a covernote number & Pol_issue date column and want to get data as in below table i want if pol_issue date is not in order its should gv me its post and pre date of its and also its covernote number .

 

covernote numpol_issue date
11\1\2016
22\1\2016
34\1\2016
43\1\2016
55\1\2016

answer should be liker dis :

 

covernote numpol_issue date
2\1\2016
34\1\2016
6\1\2016

for all data .

pls help in dis as soon as possible as i m new in qlikview .

12 Replies
hic
Former Employee
Former Employee

I am not sure what output you want, but if you use the following script

Load
If([pol_issue date]<Peek([pol_issue date]),

   'Not in order','In order') as  Condition,
*;
Load
[covernote num],
Date#([pol_issue date],'D\M\YYYY') as  [pol_issue date]

   From …

you can get a table like

Image1.png

All you need to do is to alter the If()-function in the script to return what you want.

HIC

sagarrahul
Creator
Creator
Author

thanx for ur time and answer bt sir i want the ans sholud be in dis form

covernote numpol_issue date
11\1\2016
22\1\2016
34\1\2016
43\1\2016
55\1\2016

  

covernote numpol_issue date
2\1\2016
34\1\2016
3\1\2016
sagarrahul
Creator
Creator
Author

thanx for ur time and answer bt sir i want the ans sholud be in dis form

covernote numpol_issue date
11\1\2016
22\1\2016
34\1\2016
43\1\2016
55\1\2016

 

covernote numpol_issue date
2\1\2016
34\1\2016
3\1\2016
sagarrahul
Creator
Creator
Author

sir how can 4\1\2016 be in order thanx for ur ans bt i want it in dis way

covernote numpol_issue date
2\1\2016
34\1\2016
3\1\2016
hic
Former Employee
Former Employee

Record 1-3 are in order. Record 4 is the first record that is in the wrong position.

Try the following:

FirstTable:
Load
  
RecNo() as RecordNumber,
  
If(NotInOrder or Peek(NotInOrder),True(),False()) as KeepRecord,
   *;
Load
  
If([pol_issue date]<

      Peek([pol_issue date]), True(), False()) as NotInOrder,
    *;
Load
  
[covernote num],
  
Date#([pol_issue date],'D\M\YYYY') as [pol_issue date]
  
From …;


SecondTable:
Load
  
RecordNumber,
  
[covernote num],
  
[pol_issue date]
  
Resident FirstTable
  
Where KeepRecord or Previous(KeepRecord)
  
Order By RecordNumber Desc;

Drop Table FirstTable;

HIC

sagarrahul
Creator
Creator
Author

ty so much sir . wil jst check it out 

sagarrahul
Creator
Creator
Author

sir date is not in proper order na tht is ascending order

sagarrahul
Creator
Creator
Author

sir if i m having a application then how to do it can u tell me .

sagarrahul
Creator
Creator
Author

can you give expression for this .

covernote numpol_issue date
11\1\2016
22\1\2016
34\1\2016
43\1\2016
55\1\2016

covernote numpol_issue date
2\1\2016
34\1\2016
3\1\2016