Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in calculated dimension

Dear Experts,

Our current Chart designed as below.

Dimension #1 : Period

Dimension #2 : Subgroup

Expression :  Total sales amount  [=sum(INV_AMT)]

But our exact requirement is to show profit range as dimension (as it's a calculated value, need to use expression : =((sum(INV_AMT)-sum(MATERIAL_COST))/sum(INV_AMT))*100.

When I use this expression as a dimension, I'm getting a single bar in the chart with 'Error in calculated dimension' message.

Kindly advise.

Thanks,

Saravanan

3 Replies
avinashelite

Directly you cannot use the sum function in the dimension... you need to use the Aggr() function around it then only it will work

I don't you exact requirement but you can play with the below expression and modify accordingly

=( Aggr(sum(INV_AMT) - sum(MATERIAL_COST), Period, Subgroup) / Aggr(sum(INV_AMT),Period, Subgroup) )*100. 

Kushal_Chawda

You cannot use Aggregation functions in Dimension directly, but you can use these functions with Aggr() applied over it.

try this

aggr((sum(INV_AMT)-sum(MATERIAL_COST))/sum(INV_AMT), SUB_GROUP) * 100

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try using Aggr() like below

=Aggr(((sum(INV_AMT)-sum(MATERIAL_COST))/sum(INV_AMT))*100, Period, Subgroup)


Regards,

Jagan.