Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
1. I have requirement we need to pick the Rate value column on the maxdate for six ID combination.
2. wherever there is no Rate Value i.e Rate is Null it should repeat the loop atleast for the 6 times of maxdate.
for eg: if Rate is Null it will go and check 6th ID max date and display the value ,if 6th ID is Null then will check for 5th ID Maxdate Rate value,and if 5th ID is Null will check for 4th Maxdate Rate Value and so on.....
Do we need to use Peek or Alt function.
I hope its clear the requirement.
Please find the attached Data set.
Regards
Think this way?
Table:
Load RateValue,
ID1,
ID2,
ID3,
ID4,
ID5,
ID6,
AutoNumber(Iterno(), ID1&ID2&ID3&ID4&ID5&ID6) as ID
From Table;
LET vMax6Date = Peek('ID', 6, 'Table');
If Len(RateValue)=0 Then
For i=1 to 6
Table_6_Record:
Load Max(DateField) as Max_6_Date from Table Where ID='$(vMax6Date)';
Left Join(Table_6_Record)
Load RateValue,
ID1,
ID2,
ID3,
ID4,
ID5,
ID6,
ID,
If(IsNull(RateValue) and ID=6, RateValue, Peek('RateValue_Copy')+1) as RateValue_Copy
Resident Table;
Next i
End If
Think this way?
Table:
Load RateValue,
ID1,
ID2,
ID3,
ID4,
ID5,
ID6,
AutoNumber(Iterno(), ID1&ID2&ID3&ID4&ID5&ID6) as ID
From Table;
LET vMax6Date = Peek('ID', 6, 'Table');
If Len(RateValue)=0 Then
For i=1 to 6
Table_6_Record:
Load Max(DateField) as Max_6_Date from Table Where ID='$(vMax6Date)';
Left Join(Table_6_Record)
Load RateValue,
ID1,
ID2,
ID3,
ID4,
ID5,
ID6,
ID,
If(IsNull(RateValue) and ID=6, RateValue, Peek('RateValue_Copy')+1) as RateValue_Copy
Resident Table;
Next i
End If