Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Do while

Dear Friends

I have developed a QV document with do while loop. But It does not run properly. I have attached the same and kindly help me to correct the syntax.

 

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

try this:

sales:
LOAD POLICY_NO, 
     P_FROM 
From    
TEST.xls
(biff, embedded labels, table is Sheet1$)
;

left join

load POLICY_NO,min(right(P_FROM,4)) as Y1 Resident sales Group by POLICY_NO  ;

View solution in original post

8 Replies
upaliwije
Creator II
Creator II
Author

Dear Friends,

Kindly help  me with a solution

Frank_Hartmann
Master II
Master II

please give more information what you are trying to achieve!

upaliwije
Creator II
Creator II
Author

I want my Output table to look like given below  with additional column(Y1) being populated with min year of P_From.

POLICY_NOP_FROMY1
00KU1C00074810/29/20152015
00KU1C00074810/29/20162015
00KU1C00074810/29/20172015
00KU1C00074810/29/20182015
00KU1D0006625/19/20162016
00KU1D0006625/19/20172016
00KU1D0006625/19/20182016
00KU1D0006625/19/20192016
Frank_Hartmann
Master II
Master II

try this:

sales:
LOAD POLICY_NO, 
     P_FROM 
From    
TEST.xls
(biff, embedded labels, table is Sheet1$)
;

left join

load POLICY_NO,min(right(P_FROM,4)) as Y1 Resident sales Group by POLICY_NO  ;
upaliwije
Creator II
Creator II
Author

Thanks

Is there any possibility of doing the same with do while loop ?

Frank_Hartmann
Master II
Master II

i think with a do while loop you cant achieve your desired output!

Gysbert_Wassenaar

Never use a loop when you can use a join. Loops are very slow compared to operations that work on sets of records instead of on one row at a time.


talk is cheap, supply exceeds demand
upaliwije
Creator II
Creator II
Author

Thanks for your valuable advice. I will do it with a join. Still I like to know  why my do while does not work. If you can let me have correct script for do while for my knowledge please.