Hi guys,
I need to create a calculated field that calculates the value for me considering the current month and another calculated field considering the previous month according to the date filtered by the user (filter by parameter).
ifelse(dateDiff({my_date},${Param_Date},"MM") = 0, {my_dynamic_calculated_field}, 0) -- this mount
ifelse(dateDiff({my_date},${Param_Date},"MM") = 1, {my_dynamic_calculated_field}, 0) --previous month
But I don’t need to create the above fields because I get the error “Mismatched aggregation. Custom aggregations can’t contain both aggregated and nonaggregated fields, in any combination” Error for calculated field”
Below is how the fields used were created.
--my_dynamic_calculated_field
ifelse(
${Param_Product} = 'IM', {my_calculated field_IM},
${Param_Product} = 'CS', {my_calculated field_CS},
0
)
--my_calculated field_IM
round (
(
ifelse(isNull({cc_A}), 0, {cc_A}) +
ifelse(isNull({cc_U}), 0, {cc_U}) +
ifelse(isNull({cc_P}), 0, {cc_P})
)
/
(
ifelse(isNull({cc_A}), 0, 1) +
ifelse(isNull({cc_U}), 0, 1) +
ifelse(isNull({cc_P}), 0, 1)
)
,0)
Follow the example of how “cc_A” was created:
--cc_A
round(
(
({cc_qty_A} - {cc_qty_A_2})
/
sumIf({qty_customers}, sgt= 'A' AND {product} = 'C')
)
* 100
,0)
Well, I need to create the first two calculated fields mentioned here.
How can I create these fields?
Thank you so much,
July.