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: 
MK9885
Master II
Master II

Nested value error

Hi,

I'm trying to create a set analysis function

=sum({<[Region Name]={'North America'}>}$(vOrder))

Where $(vOrder)= sum(field1)+sum(field2)+sum(field3)

If the total Order =700M and North America Total Order =170M. So I want the Total Order for only North America.


I tried the above expression and it throws me an nested agg error.


Thanks.

1 Solution

Accepted Solutions
sunny_talwar

Seems to be working for me in this sample

Capture.PNG

Only thing to make sure is that don't have a = sign in your variable definition. Try it without the equal sign

Capture.PNG

View solution in original post

8 Replies
sunny_talwar

May be try like this:

Sum({<[Region Name]={'North America'}>} Aggr($(vOrder), <YourChartDimensionsHere>))

Replace <YourChartDimensionsHere> with the dimensions you have in your chart where you are trying to perform this calculation

MK9885
Master II
Master II
Author

I don't have a dimension to this. I'm trying to achieve this in a Text object.

sunny_talwar

Then try this:

Sum({<[Region Name]={'North America'}>} Aggr($(vOrder), [Region Name]))

MK9885
Master II
Master II
Author

I've tried it and it throws me a 0 as final result.

I know the Total Order for North America is more than 100M.

Please note: vOrder = sum(Field1)+sum(field2)+sum(field3)

sunny_talwar

How about this? vOrder without dollar sign expansion?

Sum({<[Region Name]={'North America'}>} Aggr(vOrder, [Region Name]))

Would you be able to share a sample if the above doesn't work?

sunny_talwar

Seems to be working for me in this sample

Capture.PNG

Only thing to make sure is that don't have a = sign in your variable definition. Try it without the equal sign

Capture.PNG

MK9885
Master II
Master II
Author

Yes, maybe I was using = while defining the variable.

The values are matching for me now.

Thanks a lot, it was very helpful.

sunny_talwar

Awesome