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

Set Analysis ignore not working?

Hi All,

Maybe I am missing something obvious but I have been looking for a while without finding a satisfying explanation.

I have a pivot table with 2 dimensions (1 calculated) and an expression. The expression and calculated dimension both use set analysis ignoring field A (using field A=). But for some reason when I select a value in listbox list A, the values still change. Why..?

Any ideas?

14 Replies
arulsettu
Master III
Master III

post your code

gautik92
Specialist III
Specialist III

post sample data

Not applicable
Author

Dimension: if(FieldX='True', aggr(sum({<FieldA=, FieldB=, FieldC=p(FieldD), FieldE=p(FieldF)>}Counters, KeyID))

Expression: count({<FieldA=, FieldB= FieldE=p(FieldF)>} distinct KeyID)

stigchel
Partner - Master
Partner - Master

Probably because the if condition is not using the same set analysis so the results for the if condition change when making a selection. Use the same set analysis for the if with the Only function, something like

If(Only({<FieldA=, FieldB=, FieldC=p(FieldD), FieldE=p(FieldF)>} FieldX)='True'

, aggr(sum({<FieldA=, FieldB=, FieldC=p(FieldD), FieldE=p(FieldF)>}Counters, KeyID))

Expression: count({<FieldA=, FieldB= FieldE=p(FieldF)>} distinct KeyID)

sudeepkm
Specialist III
Specialist III

you said that when you select values form Field A the chart is showing results is that happening for Field B too?

Not applicable
Author

Hi,

Yes it happens to the other fields that I set as ignore as well. But the weird thing is I have the whole same expression and dimension on a different value (e.g. KeyID2) and there it works perfectly.

When removing the if statement, no improvement.

Thanks,

Neal

Not applicable
Author

I have figured out what piece of code causes it. It is one of the FieldC=p(FieldD). If I remove this the ignoring of the wanted fields work again. These fields are key fields in 2 dimension tables. Why could this cause trouble?

stigchel
Partner - Master
Partner - Master

What if you replace the FieldE=p(FieldF) in the set (and others) with

FieldE={'$(=chr(39) & replace(concat({<FieldA=, FieldB=>} distinct FieldF, '|'), '|', chr(39) & ',' & chr(39)) & chr(39))'}

tresesco
MVP
MVP

When you select in a field say FieldX, the possible values of FieldC might change, because there could be no transaction of FieldX for that FieldD(eventually FieldC) value. Therefore, selecting in FieldX might cause change in the set result even though you include it in the set.

Hope that makes sense.