Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis two fields not equal

I want to sum the sales of the customers not beloning to a that segment last year.

I'm trying:

     Sum( {$<[SEGMENT 2012]-=[SEGMENT 2013]>} SALES)

but this is not a correct expression.

Second question: How would the syntax looks like if I hadn't had the SEGMENT spilt up in years:

     Sum( {$<YEAR={2012},[SEGMENT]-=YEAR={2013},[SEGMENT]>} SALES)

1 Solution

Accepted Solutions
SunilChauhan
Champion
Champion

Try this

Sum( {$<YEAR={2012},[SEGMENT]-={$(=only({<YEAR={2013}>}[SEGMENT]))}>} SALES)

hope this helps

Sunil Chauhan

View solution in original post

6 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

See attached example...

Anonymous
Not applicable
Author

Thanks, I see your expression is also not accepted as correct syntax judging the red curly lines.

Should I ignore this?

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Ignore that "Red" curly lines..expression will ork..

Some how qlikview hates notequal sign "-=".

SunilChauhan
Champion
Champion

Try this

Sum( {$<YEAR={2012},[SEGMENT]-={$(=only({<YEAR={2013}>}[SEGMENT]))}>} SALES)

hope this helps

Sunil Chauhan
Anonymous
Not applicable
Author

LoL, your expression works but...doesn't give the right answer.

Somehow the customers with the same segment in 2012 and 2013 are also stated in the sum(sales)

Even stranger, when I want to see what the sales of the customer in the same Segment as last year are:

Sum( {$<YEAR={2012},[SEGMENT] = {$(=only({<YEAR={2013}>}[SEGMENT]))}>} SALES)

This expresion returns 0.

So '-=' includes the same segments and '=' excludes it 😉

Somebody any thoughts (hopefully without sending a sample of the document)

Gysbert_Wassenaar

I think I've just answered a similar question here. Perhaps that helps you find your solution. I think you're looking for the e() function for indirect set analysis expressions.


talk is cheap, supply exceeds demand