In need to group a column and get count of other column data on output of a query, getting below error

In need to group a column and get count of other column data on output of a query, getting below error:
Expression evaluation error in rule 'bwis_wf_rep_displayrequestcolumnchart' (called by rule 'bwis_wf_rep_displaymanagerialreport') at function a!queryEntity [line 40]: Cannot apply operator [IN] to field [requestId] when comparing to value [TypedValue[it=197,v={}]] for the code i have added.
Please find attached query code.
Thanks,
Madhu

OriginalPostID-174778

 

complete code.txt

  Discussion posts and replies are publicly visible

Parents
  • @madhubindug Not sure if the above solution has helped you or not, just now I have faced the same issue and resolved the value by converting the values to a plain array using tointeger(). The actual problem here is, the data returned by a!queryEntity() which is in the format of datasubset of dictionaries returns you an array of arrays when you try to access the fields inside the data. (for instance, local!datasubsetDeficiency.data.requestId in your case.) As IN operator expects a plain array, the queryFilter fails and hence the expression fails on the whole. So we should type cast the value of the queryFilter, i.e. we should convert the value into a plain array using functions such as tointeger() and thereafter we should provide the same to the queryFilter.
Reply
  • @madhubindug Not sure if the above solution has helped you or not, just now I have faced the same issue and resolved the value by converting the values to a plain array using tointeger(). The actual problem here is, the data returned by a!queryEntity() which is in the format of datasubset of dictionaries returns you an array of arrays when you try to access the fields inside the data. (for instance, local!datasubsetDeficiency.data.requestId in your case.) As IN operator expects a plain array, the queryFilter fails and hence the expression fails on the whole. So we should type cast the value of the queryFilter, i.e. we should convert the value into a plain array using functions such as tointeger() and thereafter we should provide the same to the queryFilter.
Children
No Data