Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This works: if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Provider', 'Non-Provider') as PROVIDER,
But this doesn't:
dual( if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Provider'),
if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0 and if(match(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Both'),
'Non-Provider')) as PROVIDER,
What is wrong with my syntax?
If your list within GOV_DECISION_BODY is separated by comma's (or similar character), you can try this
Table:
LOAD *,
If(WildMatch(GOV_DECISION_BODY, '*ECG*')+WildMatch(GOV_DECISION_BODY,'*CCG*')+WildMatch(GOV_DECISION_BODY, '*PCG*') = SubStringCount(GOV_DECISION_BODY, ',') + 1, 'Provider',
If(WildMatch(GOV_DECISION_BODY, '*ECG*')+WildMatch(GOV_DECISION_BODY,'*CCG*')+WildMatch(GOV_DECISION_BODY, '*PCG*') < SubStringCount(GOV_DECISION_BODY, ',') + 1 and
WildMatch(GOV_DECISION_BODY, '*ECG*')+WildMatch(GOV_DECISION_BODY,'*CCG*')+WildMatch(GOV_DECISION_BODY, '*PCG*') >= 1, 'Both', 'Non-Provider')) as PROVIDER;
LOAD * INLINE [
GOV_DECISION_BODY
"ECG, PCG"
"ECG, ABC"
"ABC, DEF"
];
May be
dual( if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Provider'),
if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0 and match(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Both'),
'Non-Provider')) as PROVIDER,
Remove If( from If(match(GOV.....
What is this doing?
dual( if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Provider'),
if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0 and if(match(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' )>0, 'Both'),
'Non-Provider')) as PROVIDER,
Check for exact match? Then why use * in the check part?
What if you use only this way why dual required here.
if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' ) > 0, 'Provider',
if(wildmatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*' ) > 0 and
if(match(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*') > 0,'Both'),'Non-Provider')) as PROVIDER,
The GOV_DECISION_BODY field has multiple values. I need to have Provider = Both if there is a value = '*ECG*','*PCG*','*CCG*' and one that doesn't match.
May be this
If(WildMatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*') > 0,
If(NOT WildMatch(GOV_DECISION_BODY, '*ECG*','*PCG*','*CCG*') > 0, 'Both', Provider'), 'Non-Provider') as PROVIDER
If this works, we can move to Dual part
This doesn't seem to be working. I see provider and -.
It's flagging an extra ")" somewhere.
I guess they are contradicting statements.... this will not work... testing right now
If your list within GOV_DECISION_BODY is separated by comma's (or similar character), you can try this
Table:
LOAD *,
If(WildMatch(GOV_DECISION_BODY, '*ECG*')+WildMatch(GOV_DECISION_BODY,'*CCG*')+WildMatch(GOV_DECISION_BODY, '*PCG*') = SubStringCount(GOV_DECISION_BODY, ',') + 1, 'Provider',
If(WildMatch(GOV_DECISION_BODY, '*ECG*')+WildMatch(GOV_DECISION_BODY,'*CCG*')+WildMatch(GOV_DECISION_BODY, '*PCG*') < SubStringCount(GOV_DECISION_BODY, ',') + 1 and
WildMatch(GOV_DECISION_BODY, '*ECG*')+WildMatch(GOV_DECISION_BODY,'*CCG*')+WildMatch(GOV_DECISION_BODY, '*PCG*') >= 1, 'Both', 'Non-Provider')) as PROVIDER;
LOAD * INLINE [
GOV_DECISION_BODY
"ECG, PCG"
"ECG, ABC"
"ABC, DEF"
];