Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a field called driver.
I have 5 values,
BCBS
Accuracy
Completeness
Gaps
Timeliness.
Now my requirement is
Among any combinations from the above mentioned five, I want true value. Is there a way to do this?
For example:
=if(Concat(DISTINCT [Primary Issue Driver]) = 'BCBSBCBS - AccuracyBCBS - CompletenessBCBS - DQ Control GapsBCBS - Timeliness' or
Concat(DISTINCT [Primary Issue Driver]) = 'BCBS' or
Concat(DISTINCT [Primary Issue Driver]) = 'BCBS - Accuracy' or
Concat(DISTINCT [Primary Issue Driver]) = 'BCBS - Completeness' or
Concat(DISTINCT [Primary Issue Driver]) = 'BCBS - DQ Control Gaps' or
Concat(DISTINCT [Primary Issue Driver]) = 'BCBS - Timeliness' , 'True', 'False').
I want the true values for all the combinations.
I.e on 1 selection,
2 selections, 3,4 or 5 selections.
Regards,
Varun
Try
=If( Count( {< [Primary Issue Driver] *= {BCBS,Accuracy,Completeness,Gaps,Timeliness}>} [Primary Issue Driver]), TRUE(), FALSE() )
If you want to handle cases with no selection at all as FALSE(), use
If(GetSelectedCount( [Primary Issue Driver]) AND Count( {< [Primary Issue Driver] *= {BCBS,Accuracy,Completeness,Gaps,Timeliness}>} [Primary Issue Driver]), TRUE() , FALSE() )
Wouldn't just
=If(GetSelectedCount( [Primary Issue Driver]), TRUE() , FALSE() )
fit your requirement?
Hi Swuel,
Thanks for the response. I actually have 10-15 values for Primary Issue Driver. Out of 15, I want only 5 values mentioned above.
Sorry, I didn't mention this.
its not clear ... can you upload a qvw ? if any one or more combinations cann't you write getselectedcount(field)>0 ?
if you can, add a another flag field to identify those 5 field values as 1 and all others 0 and use this field for getselectedcount(field)>0 and getpossiblecount(flagfield)>0
Try
=If( Count( {< [Primary Issue Driver] *= {BCBS,Accuracy,Completeness,Gaps,Timeliness}>} [Primary Issue Driver]), TRUE(), FALSE() )
If you want to handle cases with no selection at all as FALSE(), use
If(GetSelectedCount( [Primary Issue Driver]) AND Count( {< [Primary Issue Driver] *= {BCBS,Accuracy,Completeness,Gaps,Timeliness}>} [Primary Issue Driver]), TRUE() , FALSE() )
Can you explain me how to create a flag?
Hi Swuel,
Thanks for the response. This is working fine. Can you please explain what *= is doing in the expression?
Regards,
Varun
The intersection operator * is performing an intersection of the 5 listed values with the possible values in the default set, in other words, if you select another value than listed, the intersection would be empty, the count would return zero. Only if at least one of the 5 values is possible / selected, the count would return >0.