Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm having problems with using subfields in set expressions. I have a table called T which consists of two columns %KeyT and ValueT.
The data in T looks like this
| ValueT | |
---|---|---|
ID1|2016 | 25 | |
ID2|2016 | 75 | |
... | ... | |
ID1|2013 | 40 | |
ID2|2013 | 60 |
I want to display all the values for ID1. I've tried to use a set expression with a subfield(%KeyT, '|', 1) function to split the %KeyT field and only display ID1-values but that doesn't work. Any ideas on how to do this?
You can use %KeyT as dimension and ValueT in expression. For ValueT use below expression.
only({<%KeyT={"ID1*"}>} ValueT)
Hello Henrik,
Try this ,
if(wildmatch( %KeyT,'ID1*'),ValueT)
In the Calculated dimension try to write one of this that is working
=SubField('ID1|2016', '|',-2)
Or
=SubField('ID1|2016', '|',1)
May be these?
Sum({<%KeyT = {'ID1*'}>} ValueT)
OR
Sum({<%KeyT = P({<%KeyT = {'ID1*'}>} %KeyT)>} ValueT)
OR
Sum(Aggr(If(WildMatch(%KeyT, 'ID1*'), Sum(ValueT)), %KeyT))
OR
Sum({<%KeyT = {"=Match(Left(%KeyT, 3),'ID1')"}>}ValueT)
There is other ways for this also
Dim:- =If(WildMatch(%KeyT , 'ID1*' , %KeyT)
//Note:- Suppress when value is null selected
Expression:- Sum(ValueT)