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

Set Analysis Sum({1<DIM>}KPI) not equal Sum({$<DIM=P()>}KPI) if nothing selected

Dear Community,

as i am understanding set analysis correctly

Sum({1<DIM>}KPI) should give the same result (if nothing is selected of DIM) like Sum({$<DIM=P()>}KPI)

But Sum({$<DIM=P()>}KPI) shows not the same number, its only nearly (95%) the same as  Sum({1<DIM>}KPI) !

Why is this happening, where is my mistake?

20 Replies
Digvijay_Singh

This may avoid nulls in first expression, not sure though..

Sum({1<DIM={"*"}>}KPI)

Anonymous
Not applicable
Author

Yes this avoids nulls (2=1), but what if i need the opposite so that 2) should include the nulls (1=2)

Digvijay_Singh

See this sample -

Set NULLINTERPRET = '';

load * inline [

DIM,KPI

1,100

,100

3,100

4,100 ]

Capture.JPG

Not the perfect way but 2nd expression regards the selections and includes null as well.

Anonymous
Not applicable
Author

ok, but is there no possibility to do this with set analysis? Set analysis seems powerfull, maybe there is a way to include also null values with P()

tresesco
MVP
MVP

I think this works.

=Sum({1<DIM=p(DIM)>+1-<DIM=e(DIM)>}KPI)

However, there should be a neater solution; wait for someone to come up with.

Digvijay_Singh

Vow! this works, couldn't understand the use of '+1' here, can you pl help! Thanks

tresesco
MVP
MVP

'+' is OR/Union operator here.

1-<DIM=e(DIM)> - excludes the excluded values (anyway they are included in the first part of union)  but includes NULL.

So, the first part is with all non-null values and the second part of union includes NULL. Hope this helps.

Digvijay_Singh

Thanks! Didn't know we can use whole set '1' like this as well.

Anonymous
Not applicable
Author

Hi tresco, good idea, but this works only if nothing is selected, when selecting something of DIM the result will be wrong. Null values are only interesting if nothing is selected. If selected only the selected is interesting.

tresesco
MVP
MVP

With me it is working even with selection. Could you post a sample that demonstrates the issue?