Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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!