Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I have one column, 'Cause Code'. The few values of 'Cause Code' should be grouped together.
'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing' should be grouped as 'Data Issue'.
The summed values should be shown against 'Data Issue'.
Can you please suggest me? Appreciate your valued suggestions.
Thanks.
Try if this helps:
Table1:
LOAD [Cause Code],
If(Match([Cause Code], 'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing'), 'Data Issue') as Data Issue,
Value
Resident SomeTable;
Join (SomeTable)
LOAD [CauseCode],
Sum(Value)
Resident Table1
Group By Data Issue;
Best,
S
Hi,
You can use a Lookup Table and use APPLY MAP to get the result.
Regards,
Nandkishor
Hi NandKishor - Thanks for your response. Can you please provide me a sample code. Thanks
Sample Look-up Table like below
LOAD * INLINE
[
Cause Code , Output
Data Entry Issue, Data Issue
File Missing/Deleted,Data Issue
Data Exception,Data Issue
];
and use Apply map to existing query and pass 'cause code'
Try if this helps:
Table1:
LOAD [Cause Code],
If(Match([Cause Code], 'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing'), 'Data Issue') as Data Issue,
Value
Resident SomeTable;
Join (SomeTable)
LOAD [CauseCode],
Sum(Value)
Resident Table1
Group By Data Issue;
Best,
S
Hi Sasi,
You may try an If() clause to Match the field values and to group them,
In the script,
if(Match([Cause Code], 'Data Entry Issue', 'File Missing/Deleted', 'Data Exception' ,'Data Invalid Missing'),'Data Issue'
,[Cause Code]) // Else takeup values in [Cause Code]
Hope it helps !
Cheers !