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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
saaskve1
Contributor
Contributor

How can I use calculated dimension in difference calculation

Hello,

I am having problems with calculated dimension.

I would like to calculate variance for different data versions as shown in really simple example below...

Dimension is Version and Expression definitions are in below.

So, how should I calculate the variance for Versions?

Expressions       ActualBudgetVariance
=sum({$<Version = {'Actual','Budget'}>}Sales)Sales50045050
=sum({$<Version = {'Actual','Budget'}>}Costs)Costs35833028
=((column(1)-Column(2))/Column(1)Margin%28%27%2%

Data model is like below:

FieldData
Version(Actual, Budget...)
Sales

(values)

Costs(values)
3 Replies
saaskve1
Contributor
Contributor
Author

Hi,

Does anyone have any ideas?

It would also be helpful information to know if it can't be done so I could try something else...

christian77
Partner - Specialist
Partner - Specialist

Calculated dimensions don´t take functions like sum, avg, etc. They only allow ifs. Do your calculations on the script.

Also, I think some people are confusing variance and variation. They are two different things.

Ok.

saaskve1
Contributor
Contributor
Author

Thanks.

I will try another approach.