Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
I have table, in which their is one column as Comment.
Comment
Your network is good
Thanks, you have provide nice service to us
Great network
Superlative service
Sorry I don’t like your service, so bad experience with your network
Suppose i have 5 comments,
Out of that 5, 4 comment contains word as good, nice, great, superlative which should be consider as Excellent
and count of Excellent should be 4. Remaining one comment having word is bad which should be consider as awful,
and count of awful is 1.
How can i overcome this requirement.
Please guide me.
- Thanks and Regards,
Villyee.
='GOOD COMMENTS : '& SUM(AGGR(IF(WildMatch(UPPER(Comment),'*GREAT*','*SUPERLATIVE*','*NICE*','*GOOD*'),1),Comment)) & CHR(10) &
'BAD COMMENTS : '& SUM(AGGR(IF(NOT WildMatch(UPPER(Comment),'*GREAT*','*SUPERLATIVE*','*NICE*','*GOOD*'),1),Comment))
I would use Wildmatch and a Mapping Table (or just link an inline table) - n.b. replace Excellent and Bad i.e.
map_Comment_Codes:
LOAD * Inline [
CommentCode, CommentType
0, Excellent
1, Excellent
2, Excellent
3, Excellent
4, Bad
];
wildmatch(Comment,
'*good*',
'*nice*',
'*great*',
'*super*',
'*bad*'
)
// Assigns a unique number (CommentCode) to each Comment Type
as CommentCode