Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have to load data based on condition like
CUSTOMER POLICY_NO
A P1
A P2
B P1
C P2
D P1
D P2
If the customer is enrolled to both P1 and P2 policies, then load only P2.
Output:
CUSTOMER POLICY_NO
A P2
B P1
C P2
D P2
Few questions.
1. Every Customer has only two policies or it will be more policies Ex (P1,P2,P3....)
2. Will it be only two policies P1,P2.
Try This:
data:
LOAD * INLINE [
CUSTOMER, POLICY_NO
A, P1
A, P2
B, P1
C, P2
D, P1
D, P2
];
test:
Noconcatenate LOAD
CUSTOMER,
'P'&Max(right(POLICY_NO,1)) as POLICY_NO
Resident data
Group By CUSTOMER;
Drop Table data;
I think the main component here would be DATES!
I assume your exact requirement would be to load latest Policy taken?
If not please confirm your exact requirement
Hi,
Check below script
Data:
LOAD * INLINE [
CUSTOMER, POLICY_NO
A, P1
A, P2
B, P1
C, P2
D, P1
D, P2
];
INNER JOIN(Data)
LOAD
CUSTOMER,
Maxstring(POLICY_NO) AS POLICY_NO
RESIDENT Data
GROUP BY CUSTOMER;
Regards,
Jagan.
If you have more than policy per customer and may be two simple do this in UI part for the customer
Ex:-
LOAD * INLINE [
CUSTOMER, POLICY_NO
A, P1
A, P2
B, P1
C, P2
D, P1
D, P2
];
Straight Table:-
Dim:- CUSTOMER
Expression:- =MaxString(POLICY_NO)