Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add calculated dimension

Hello;

I am trying to add a calculated dimension to a chart and the legend returns an error.

The statement used works well in an expression but not in the dimension side.

Any idea why?

This is the statement in question.

=if(

(If(ActivityType='INEN'OR ActivityType='ISSS'OR ActivityType='IDOA',1,0))

+

(if(((SUM(_Hours_worked))/[Target Inst Hours])>0 and ((SUM(_Hours_worked))/[Target Inst Hours])<0.3 or ((SUM(_Hours_worked))/[Target Inst Hours])>1.5,1,0))>0,'Problem','No Problem')


Many thanks in advance for your answer.

Kristel.


1 Reply
vgutkovsky
Master II
Master II

If you want to use aggregation in a calculated dimension, you will need to wrap it in an aggr() function--remember, that at the dimension level, QlikView does not yet know what dimension it should be aggregating across, so requires an explicit aggr() definition.

Regards,

Vlad