Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I want to use set analysis to calculate one value regardless of any current selection except one field
I have an expression:
=count({1}[Application Id for Counters]) - counts all ids disregarding current selection correctly.
I need to make sure that the only one field [Application Type] influences this count
Thanks
Hi,
I haven´t prove it, but you can do something like this:
=count({1+$<[Application Type]={"*"}>}[Application Id for Counters])
Best Regards!
does not work.
What * means here? I need to make sure that If I filer on some [Application Type] the count will change.
Perhaps this?
count({1<[Application Type]=P()>} [Application Id for Counters])
The P() says to use possible application types. I think that won't always be the selected application types, though, if other selections narrow the list down further than your selections. So it's not completely ignoring all other selections in that sense. There are more complicated ways around that, but you may not need them, so let's start with the above. If it works for you, no reason to do something more complicated.
Is Application Type a string field?
Try:
=count({1<[Application Type]=
{'$(=if(GetSelectedCount([Application Type])>0,
GetFieldSelections([Application Type], Chr(39) & ',' & Chr(39)), Chr(42)))'}>}
[Application Id for Counters])
That will pull all Application types when none are selected or only the selected Application Types. The Chr(39) & ',' & Chr(39) is you put quotes around the values. The quotes are only needed on string fields.
Edit: Changed the * to a Chr(42)
And NMiller gives the more complicated but arguably more correct answer. 🙂
Thank you NMiller.
The Application Type is 1 char field.
This expression works correctly only if some [Application Type] is selected. However when there is no selection on this field I need to have a count disregarding this selection ( no filtering on Application Type) - the biggest number. However I am getting 0 with this expression.
Any Ideas?
If there are no selections, you should get Application Type = '*', which should show anything.
Put the expression into a table chart, but don't give it a label. When the chart is rendered, you should see the expression with the dollar sign expansion evaluated. When nothing is selected in Application Type, you should see:
count({1<[Application Type]={'*'}>} [Application Id for Counters])
It should be able to handle no selections.
The main expression evaluates to "-" when no selection is done,
When I used count({1<[Application Type]={'*'}>} [Application Id for Counters]) just to test it gives me the correct number, which tels me that when there is no selection evaluation of the expression is not correct.
I also was wrong - Application Type is a character field -consists of multiple words. Can that be a problem?Could not see the error
Application Type should work whatever the field type is. It could even work for integers, but the quotes are unnecessary and more complicated.
You need to look at the results of your dollar sign expansion. In my sample, with nothing selected, I get ='*' and from your description that expression is working for you when explicitly defined.
Create a chart. Add your expression, but don't give it a label. Make sure no selections are made in Application Type. Copy the cell contents of the expression header and paste it in here.