Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

Expression as a dimension

=if([Data Category]<>'Adjusted', null(), avg(ACT_GBP.Materiality))



Any ideas how I would write the above as a dimension?


1 Solution

Accepted Solutions
rubenmarin

So, you want the average of ACT_GBP.Materialty where [Data Category]='Adjusted'?

It can be: Avg({<[Data Category]={'Adjusted'}>} ACT_GBP.Materiality)


Just to advise, you can create expressions without dimension if you only want a bung of predefined calculations.

View solution in original post

3 Replies
sunny_talwar

You will need some kind of Aggr function here. What exactly are your Averaging ACT_GBP.Materiality over (which dimension)?


=If([Data Category]<>'Adjusted', null(), Aggr(avg(ACT_GBP.Materiality), DimensionName))


or may be this


=If([Data Category] = 'Adjusted', Aggr(avg(ACT_GBP.Materiality), DimensionName))

rubenmarin

So, you want the average of ACT_GBP.Materialty where [Data Category]='Adjusted'?

It can be: Avg({<[Data Category]={'Adjusted'}>} ACT_GBP.Materiality)


Just to advise, you can create expressions without dimension if you only want a bung of predefined calculations.

marcus_sommer

Have a look here:

Calculated Dimensions

Buckets

- Marcus