issue with reject(fn!isnull, 'array of arrays') function on a data generated from an expression rule

 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:

 {"Outbound", 1, "Mudcakes", 2, "Happy Industries", 2}
 
which is not what I am looking for, as I would expect to have something more like this:
i
{{"Outbound", 1},{"Mudcakes", 2}, {"Happy Industries", 2}}
 
Below the pie chart as it looks now:

 

 

Any suggestions?

 

Thanks!

Manuel

  Discussion posts and replies are publicly visible