Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calling expressions

I am trying to make this work:

(Sum (if (Belåningsgrad <= 0.6, tot_engasjem))+ sum(under_60))*0.05

Where under 60 is a an expression that I have calculated earlier, it comes up in blue colour so I thought I could use it. However it dosen't seem to work as planned

1 Solution

Accepted Solutions
Not applicable
Author

Hi kiteulfen99,

The problem is the sum within the sum. Say you have dimension [country].

The expression that is worked out previously, "under_60" is for that [country]. You are then trying to sum it again within [country], it will not work. Basically it is like writing sum(sum (if (Belåningsgrad <= 0.6, tot_engasjem))) within that expression,

What is the result that you are aiming for? Perhaps you could try aggregated expressions or totals to evaluate the sum(over_60) over different dimensions or

You could leave it as

(Sum (if (Belåningsgrad <= 0.6, tot_engasjem))+ under_60)*0.05

Let me know if you would like me to explain further,

Regards,

Erica

View solution in original post

6 Replies
Not applicable
Author

I don't know how "under_60" is defined, but you can try:

(Sum (if (Belåningsgrad <= 0.6, tot_engasjem))+ sum($(under_60)))*0.05

Not applicable
Author

My 'under_60' is defined as

Sum (if (Belåningsgrad <= 0.6, tot_engasjem))

Not applicable
Author

Hi kiteulfen99,

The problem is the sum within the sum. Say you have dimension [country].

The expression that is worked out previously, "under_60" is for that [country]. You are then trying to sum it again within [country], it will not work. Basically it is like writing sum(sum (if (Belåningsgrad <= 0.6, tot_engasjem))) within that expression,

What is the result that you are aiming for? Perhaps you could try aggregated expressions or totals to evaluate the sum(over_60) over different dimensions or

You could leave it as

(Sum (if (Belåningsgrad <= 0.6, tot_engasjem))+ under_60)*0.05

Let me know if you would like me to explain further,

Regards,

Erica

Not applicable
Author

Why dont you try to use the column function, I used before and works fine. Ex:

=(Sum (if (Belåningsgrad <= 0.6, tot_engasjem))+ column(1) *0.05


Not applicable
Author

Yes thanks Erica,

That did the trick. However my expression is now

(Sum (spob_engasjem)+ under_60)*0.05 now it remains to just put in all the other expressions . But hopefully I will manage to do it.

Best

Kiteulfen

Not applicable
Author

You're welcome!

Regards,

Erica