Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Honored Contributor 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
Highlighted

Re: Nested value error

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
Highlighted

Re: Nested value error

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

Highlighted
Honored Contributor II

Re: Nested value error

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

Highlighted

Re: Nested value error

Then try this:

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

Highlighted
Honored Contributor II

Re: Nested value error

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)

Highlighted

Re: Nested value error

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?

Highlighted

Re: Nested value error

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

Highlighted
Honored Contributor II

Re: Nested value error

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

The values are matching for me now.

Thanks a lot, it was very helpful.

Highlighted

Re: Nested value error

Awesome