Hi Community,
I have a strange problem with the reject function. I am getting an error when I work with the data generated with my expression rule. If I do a copy & paste of the data generated, the function does not give me an error but I am not getting what I expected.
A further description of the problem (as maybe I am just taking the wrong approach), I have on CDT on which one of the values is the id's of another CDT. I wanted to count how many times the second CDT is used, so I can have a graphical representation in a form of a pie chart. My expression rule gives returns the data in a way that is easy to work on graphs, like the pie chart below.
When I call the expression rule, I get the data like this:
{{}, {}, {}, {}, {}, {}, {}, {}, {"Outbound", 1}, {}, {"Mudcakes", 2}, {"Happy Industries", 2}, {}, {}}
Which means that "Outbound" appears 1, "Mudcakes" 2 and "Happy Industries" 2
On the pie chart, the values "{}" appears like [Series 1], [Series 2] and so on. I want to get rid of those empty arrays.
Then, I try to use the function reject, like below
reject(fn!isnull,rule!APP_myExpresionRule), it troughs me an error
Expression evaluation error at function 'reject': Incorrect number of parameters for function; expected 1 parameters, but found 0 parameters
Now, when I copy the data generated with rule!APP_myExpresionRule,
reject(fn!isnull,{{}, {}, {}, {}, {}, {}, {}, {}, {"Outbound", 1}, {}, {"Mudcakes", 2}, {"Happy Industries", 2}, {}, {}})
I get this:
Any suggestions?
Thanks!
Manuel
Discussion posts and replies are publicly visible
Thank you very much, that way worked for the reject function!
first I store on a local variable and call: local!aux.data
Then I get:
{null, null, null, null, null, null, null, null, {name: "Outbound", count: 1}, null, {name: "Mudcakes", count: 2}, {name: "Happy Industries", count: 2}, null, null}
Now I can call reject() : reject(fn!isnull,local!aux.data)
And then I get: