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

AND operation in set analysis

Hello

In the example as attached, I would like to count how many IDs with '*-RAM' and their [Ship Year] is '2009'.

The express 'Dispatch' is given as

Sum(Aggr(Count (DISTINCT {<ID = p({<[Ship year]={'2009'}>}) * p({<ID={'*-RMA'}>})>}ID),CalendarYY,CalendarWW))

The Dispatch count should be zero for CalendarYY = 2009 and CalendarWW = 01.

Somehow, Dispatch shows 8 and it seems the expression only considers the term ID='*-RMA' only.

Where did I make a mistake?

Thanks,

Josh

1 Solution

Accepted Solutions
sunny_talwar

I think you used Ship year instead of Ship Year. But this also seems to work for the selection. QlikView is case sensitive and they two things are different for it.

Sum(Aggr(Count (DISTINCT {<[Ship Year]={2009}, ID = {'*-RMA'}>}ID),CalendarYY,CalendarWW))

View solution in original post

3 Replies
sunny_talwar

I think you used Ship year instead of Ship Year. But this also seems to work for the selection. QlikView is case sensitive and they two things are different for it.

Sum(Aggr(Count (DISTINCT {<[Ship Year]={2009}, ID = {'*-RMA'}>}ID),CalendarYY,CalendarWW))

Anonymous
Not applicable
Author

LOL...that obvious.

Thank you again.

Josh

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Josh,

the issue is rather silly - your [Ship Year] was misspelled as [Ship year] and the filter was ignored. Unfortunately, the spell checker doesn't pick it up as an error and doesn't give you a warning. That's a bug.

Besides this typo, watch the level of granularity in your AGGR, compared to your Chart dimensions. Your AGGR appears to be less granular than your chart, which may give you incorrect results.

Learn more advanced techniques about Set Analysis, AGGR, and more, in my book QlikView Your Business.

cheers,

Oleg Troyansky