I want to subtract values of 2 calculated fields called “sales” and “mean”.
I have calculated sum using group by for “sales” as:
sum({q_requested},[{prod_id},{s_id},{seg_id},{seg_type},{c_id},{o_p_id},{prod_type},{prod_brand},{fore_date},truncDate("MM",{order_date})])
,
also calculated average for a mean value “mean” as:
avg({mean_value},[{prod_id},{s_id},{seg_id},{seg_type},{c_id},{o_p_id},{prod_type},{prod_brand},{fore_date},truncDate("MM",{order_date})])
.
Now i want to subtract values of these two fields:
{sales}-{mean}
to calculate a error between 2 values, but the visual provides me a error of this caliber.
“The LAC aggregate functions inside one visual aggregate function should always share the same grouping key”.
While trying to visualize in a table, with same grouping keys.