Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am creating a number of QVDs within a loop and depending on which loop the current 'pass' is I want to write a value into the qvd.
For example.
DO WHILE counter < 3
TIMES:
load
[KEY],
if(counter =0 ,'AM',
if(counter =1 ,'PM',
if(counter =2 ,'ALLDAY'))) as TIME_TYPE,
START_DATE,
END_DATE
Resident LOAD1;
left join
load
STATUS_ID,
NAME,
STATUS_VALUE,
[KEY]
RESIDENT [STATUS];
counter=counter+1;
STORE TIMES INTO....;
DROP TABLE TIMES;
LOOP;
So, depending on what part of the loop the script is in, I want to reference this in the table I am creating.
I have tried the above If Statement - but I am getting an error.
Cananyone advise please?
Thanks,
Phil
Couple of things...
1) Do you initiate your counter variable?
LET counter = 0
2) Use it like this may be
Pick($(counter) + 1 , 'AM', 'PM', 'ALLDAY') as TIME_TYPE
Couple of things...
1) Do you initiate your counter variable?
LET counter = 0
2) Use it like this may be
Pick($(counter) + 1 , 'AM', 'PM', 'ALLDAY') as TIME_TYPE
without if
for each timetype in 'AM', 'PM', 'ALLDAY'
TIMES:
load
[KEY],
'$(timetype)' as TIME_TYPE,
START_DATE,
END_DATE
Resident LOAD1;
left join
......
next
Perfect thanks!
Phil