Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis and charts problem

This is possibly quite basic but what am I missing here? I have an order table that is read to my qv-module. I have two diffrent Ordernumbers, lets call them O1 and O2. O1 is in the order table but O2 is in another table that is keyed to the order table with an unique key.

So for example if O1 is 123456 it has a representation in O2 of 242424, but! 242424 is also in O1 (these are just arbetrary numbers)

What I want to do in my chart is to get O1 and the representating O2 and then the =sum(Value) for the number of O2 in the O1. To illustrate somewhat:

O1 -- O2 -- Value
123456 -- 242424 -- 1000 (this being the Value of O1=242424)
555555 -- 777777 -- 2000 (this being the Value of O1=777777)

The problem I have is that I can't get the correct values in "Value". I've tried using set analysis with various syntaxes:

=sum({<O1= {$(=O2)}>} Qty*ItemValue)

But I always get '0' in this field

Anyone have any ideas why this is and what I'm doing wrong here?

4 Replies
Not applicable
Author

Hi Mauich,

I am not quite sure. Maybe you can post your application?

cheers

Florian

Not applicable
Author

It's very big and complex but I can try to cut out this code to show you

Not applicable
Author

Load

OrderDate,

CustomerNbr,

OrderNbr

OrderNbrKEY,

Type,

Season

FROM [OrderHead.qvd] (qvd);

LOAD

OrderNbrKEY,

text(Swap) as OrderNbrSWAP

FROM [OrderHeadSwap.qvd] (qvd);

That's the part of my load script that I'm working with here.

It should look like this

But I get Value = 0 for whatever I do.

Not applicable
Author

Hi Mauich,

I had a similiar discussion with a collegue today and set analysis is the wrong approach. You should use an IF statement instead, I believe this will work.

cheers

Florian