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: 
Not applicable

Chosing some of the cases

=if(m3_tot_engasjem>=tot_engasjem,sum(m3_tot_engasjem/tot_engasjem)

I want to give a percentage increase for those that have increased their sum, omitting those that have decreased their amount.

Data is like:

tot_engasjemm3_tot_engasjem
1959998.01988297.0433477424
24027.027675.626156287075
159082.0133511.56486189537
2044.01722.672091871297
54219.054711.763840512234
550000.0410286.25930142036
1070062.0865880.910229268
125000.0127502.63405138304
490062.0498072.2405880773
4331.03988.525178964708
28214.023919.60232069539
133568.0126660.41474844047
389661.0342787.3709764202
450000.0388604.4426733665
607711.0581597.413582825
51406.048206.72875358108
18501.016486.762579572922
21219.017759.202986170505
253211.0253733.05072192842
963095.0936906.0609524274
1239794.01307198.2491753774
131839.096661.59870819317
407503.0446913.1083573017
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Try

Avg($(vTot)) Or Avg($(=$(vTot)))

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
Not applicable
Author

What is your question? Does your expression not work?

Maybe you could try if(sum(m3_tot_engasjem)>=sum(tot_engasjem),sum(m3_tot_engasjem)/sum(tot_engasjem))

Anonymous
Not applicable
Author

Hi kiteulfen99,

I guess your expression is correct. All you need to remove is the sum

=if(m3_tot_engasjem>=tot_engasjem,(m3_tot_engasjem/tot_engasjem))

Beacuse may be you dont wish to take the sum aggregrate of it.

This may work for you or you can even use frankcrezee expression and convert the format with number and Show in %


Not applicable
Author

I am still having problems with this:

SET vTot = if (m3_tot_engasjem>=tot_engasjem,(m3_tot_engasjem)/(tot_engasjem)-1);

When I am using this variable later on with an avg(vTot)  it renders just blanks over the dimensions.

Kiteulfen 99

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Try

Avg($(vTot)) Or Avg($(=$(vTot)))

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein