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

Expresion wont work!

Im creating this Expressions and i cant get it to work.

sum({$<Offerte.Jaar={$(=Only(Offerte.Jaar))}>} ($(vNettoBedrag) )

The variable is like this : sum(OfferDetail.NETSALESAMOUNT) + sum(OfferMisc.NETSALESAMOUNT)

Any help?

1 Solution

Accepted Solutions
Not applicable
Author

You will have to enclose it in an aggr like follow:

aggr(sum(OfferDetail.NETSALESAMOUNT) + sum(OfferMisc.NETSALESAMOUNT),Dimension1, dimension2)

Replace the Dimension1 etc with the dimensions you use in the chart.

This can then be used to sum with the other sum function.

Try this and when you get the result you can change the sums for a variable, remember that variables can return the string strange so double check it is expanded correctly.

//John

View solution in original post

4 Replies
hector
Specialist
Specialist

Hi,

i think the problem is that you can't use sum( sum() ...), except if you use aggr() before the main sum()

check your formula, if this is valid change for


sum({$<Offerte.Jaar={$(=Only(Offerte.Jaar))}>} $(vNettoBedrag) )
And
vNettoBedrag = OfferDetail.NETSALESAMOUNT + OfferMisc.NETSALESAMOUNT



rgds

Not applicable
Author

Hey Hector thank you for your quick responce.

Using sum( sum( is indeed the problem. However if i change my variable to your suggested code i get a wrong result. The numbers go minus and one number skyrockets

Not applicable
Author

You will have to enclose it in an aggr like follow:

aggr(sum(OfferDetail.NETSALESAMOUNT) + sum(OfferMisc.NETSALESAMOUNT),Dimension1, dimension2)

Replace the Dimension1 etc with the dimensions you use in the chart.

This can then be used to sum with the other sum function.

Try this and when you get the result you can change the sums for a variable, remember that variables can return the string strange so double check it is expanded correctly.

//John

Not applicable
Author

Works Perfect Thank you!