Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sanp96
Contributor III
Contributor III

Set expression and wrong selections

Hello everyone,

I have been working on this problem for a few days now with no luck and hence reaching out to you all here. I have a bar chart with the  bar measure as:

Count(distinct {<[ProductCode]-={'Finance Spread'},[leasetype]={'L'}>+<[ProductCode]={'Finance Spread'},[leasetype]={'P'}>+<[ProductCode]-={'Finance Spread'},[leasetype]={'P'}>}[dealno])

This results in the following chart

sample1.png

The issue is if I Select 'VSC' from the filter, 'Finance spread' Still stays in the selection. 

To solve this, I tried to change the measure to (Added the '$' sign): 

Count(distinct $ {<[ProductCode]-={'Finance Spread'},[leasetype]={'L'}>+<[ProductCode]={'Finance Spread'},[leasetype]={'P'}>+<[ProductCode]-={'Finance Spread'},[leasetype]={'P'}>}[dealno])

Now this shows the correct selection but gives me the wrong count. 

 

Is there any other way I could do this and get the correct count and selection?

Any help is highly appreciated. 

 

Thank you!

Labels (5)
1 Solution

Accepted Solutions
Or
MVP
MVP

I'm having a hard time understanding what exactly you're trying to achieve. You seem to have hard-coded Finance Spread (with leasetype = P) into your set analysis, so it's always going to show up regardless of your selection on the ProductCode field, if that's what you mean. You could probably work around that if the selection excludes this value by using something like:

<[ProductCode]={'Finance Spread'},[leasetype]={'P'}>*<$>

Which would be the intersection of the finance spread / P values with the current selections.

View solution in original post

2 Replies
Or
MVP
MVP

I'm having a hard time understanding what exactly you're trying to achieve. You seem to have hard-coded Finance Spread (with leasetype = P) into your set analysis, so it's always going to show up regardless of your selection on the ProductCode field, if that's what you mean. You could probably work around that if the selection excludes this value by using something like:

<[ProductCode]={'Finance Spread'},[leasetype]={'P'}>*<$>

Which would be the intersection of the finance spread / P values with the current selections.

sanp96
Contributor III
Contributor III
Author

Great! That seems to have solved the issue. Apologies for not being clear in the question.

Thanks a lot! Appreciate your help!