Hi Experts,
We are getting CONTEXTUAL_SYNTAX_ERROR in two calculated fields while migrating the dashboard. Have cross checked and the same fields do not throw any error at analyses/dashboard level and also giving correct data. The definition of both fields are as below :-
-
Avg Entity True Positive Indicator - distinct_count(ifelse({Entity True Positive Indicator_Alias}=‘True Positive’,{entity_id},NULL))/sumOver(distinct_count({entity_id}),[{Entity Number Of Alerts_Dim}])
-
True Positive Alert Ids - ifelse({Alert True Positive Indicator}=1,{Original Alert Id},NULL)
Here {Entity True Positive Indicator_Alias} = ifelse({Entity True Positive Indicator}=0,‘False Positive’,‘True Positive’)
AND
{Entity True Positive Indicator} = “ifelse(
${TruePositiveMeasure} = ‘At least one alert is “Issue”’,
ifelse(
{Entity Number of Issue Alerts} > 0,
1,
0
),
${TruePositiveMeasure} = ‘At least one alert added to Case’,
ifelse(
{Entity Number of Alerts in Case} > 0,
1,
0
),
${TruePositiveMeasure} = ‘At least one form filed’,
ifelse(
{Entity Number of Alerts with Form Filed} > 0,
1,
0
),
${TruePositiveMeasure} = ‘4’,
ifelse(
{Entity Number of Alerts} = 0,
0,
ifelse(
{Entity Number of Issue Alerts} / {Entity Number of Alerts} >= ${MinimumAlertPerc},
1,
0
)
),
${TruePositiveMeasure} = ‘5’,
ifelse(
{Entity Number of Alerts} = 0,
0,
ifelse(
{Entity Number of Alerts in Case} / {Entity Number of Alerts} >= ${MinimumAlertPerc},
1,
0
)
),
${TruePositiveMeasure} = ‘6’,
ifelse(
{Entity Number of Alerts} = 0,
0,
ifelse(
{Entity Number of Alerts with Form Filed} / {Entity Number of Alerts} >= ${MinimumAlertPerc},
1,
0
)
),
0
)”
where ${TruePositiveMeasure} is a static defined parameter with values At least one alert is “Issue”, At least one alert added to Case & At least one form filed, {Entity Number of Issue Alerts} , {Entity Number of Alerts in Case}, {Entity Number of Alerts with Form Filed} and {Entity Number Of Alerts} where {Entity Number of Issue Alerts} has formula sumOver({alert_is_issue}, [{entity_id}],PRE_FILTER). Here ${MinimumAlertPerc} is a integer parameter with static value 60.
For True Positive Alert Ids field {Alert True Positive Indicator} = "ifelse(
${TruePositiveMeasure} = ‘At least one alert is “Issue”’, ifelse(
${ExcludeNonAMLReasonCodesfromTPNo}=‘Yes’ AND coalesce({reason_code_is_aml}, ‘No’) = ‘No’, 0, {alert_is_issue}),
${TruePositiveMeasure} = 'At least one alert added to Case', ifelse(
${ExcludeNonAMLReasonCodesfromTPNo}='Yes' AND coalesce({reason_code_is_aml}, 'No') = 'No', 0, {alert_is_in_case}),
${TruePositiveMeasure} = 'At least one form filed', ifelse(
${ExcludeNonAMLReasonCodesfromTPNo}='Yes' AND coalesce({reason_code_is_aml}, 'No') = 'No', 0, {form_filed_for_alert}),
NULL
)"
where ${ExcludeNonAMLReasonCodesfromTPNo} is a static string parameter with values Yes & No and {reason_code_is_aml}, {alert_is_issue}, {alert_is_in_case} & {form_filed_for_alert} are string fields coming from source.
{Original Alert Id} = ifelse({number_of_alerts}=0,NULL,{alert_id}) where {number_of_alerts} is a direct measure field and {alert_id} is a direct dimension field.