我需要有类似的客户端ID批次元素(字符串类型,但目前只有数值,如“12345”,“235134”等)配料中的Java和Excel给出不同的结果
Map<String, List<Client>> _batched = new HashMap<String, List<Client>>();
for (Client c : _Clients)
{
String id = c.getIdClient();
List<Client> clients = _batched.get(id);
if(_clients == null){
clients = new ArrayList<Client>();
_batched.put(id, clients);
}
clients.add(c);
}
的问题是,当我比较的Excel(=SUM(IF(FREQUENCY(C2:C618,C2:C618)>0,1))
)的结果,此功能的话,我得到不同的结果,即526和519
是什么错我的代码?
不知道你是否在问题中输入了错误的代码,但你似乎正在使用'_clients'和'clients'来引用for循环中的同一个列表。 – SamYonnou