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
Thanks for the Idea, but it is not the right solution. For reaching that solution the best would be to use touniformstring() and then the reject function. The problem there is that then I get a flat array, which does not work for the graphical representation of the pie chart.
Rather than having and Index, the solution was to make it a datasubset.
Thanks for the suggestion.