Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Expression for filtered results

Hi guys,

I am trying to build table that should get the following results:

 CURRENT EXPECTED Matchcodes Matchcodes Sales A123 A123 1000 B123 B123 2000 A234 A345 A456 A456 5000 B234 B234 6000

Matchcodes to filter are: 'A123', 'B123', 'A456', 'B234'

Unfortunately the expression I wrote is not working:

Sum({<PeriodeMath={'>=\$(vMinPeriodeJahr2)<=\$(vMaxPeriode2)'},Matchcode={'A123', 'B123', 'A456', 'B234'}>}Sales)

Can you help me out with that one? Thanks so much!

Nes from Austria

Labels (3)

• ### Sales

1 Solution

Accepted Solutions
MVP

Why don't you create an Island Table with all the MatchCodes you need like this

``````LOAD * INLINE [
MCNeeded
A123
B123
A456
B234
...
];``````

and then try this as your expression

``Sum({<PeriodeMath = {'>=\$(vMinPeriodeJahr2)<=\$(vMaxPeriode2)'}, Matchcode = p(MCNeeded)>} Sales)``
6 Replies
MVP

So, it is showing all MatchCodes, but Sales is showing up as 0? Or do you see Sales showing up for A234 and A345?

Contributor III
Author
I would like to only show the Sales that are filtered. A234 and A345 shall
disappear.
MVP

I get that... but are you saying that even after adding set analysis (Matchcode={'A123', 'B123', 'A456', 'B234'}) to show these match codes... you see A234 and A345 with Sales value?

Contributor III
Author

Yes exactly. I do not have that issue with other formulas. Maybe it is because of the number of filters set? Because there are actually over 900 matchcodes that I added to the filter. 😄

MVP

Why don't you create an Island Table with all the MatchCodes you need like this

``````LOAD * INLINE [
MCNeeded
A123
B123
A456
B234
...
];``````

and then try this as your expression

``Sum({<PeriodeMath = {'>=\$(vMinPeriodeJahr2)<=\$(vMaxPeriode2)'}, Matchcode = p(MCNeeded)>} Sales)``
Contributor III
Author

Thank you, you are absolutely right!

Community Browser