Yes, but your example would produce nothing I assume. You are only gathering data about processor count, and then filtering on that to only include information about memory.
EDIT: To clarify, subsets restrict what data is gathered from the system, filtering filters the gathered information down to specific keys. Filters do not impact what data is gathered, only what is ultimately returned after gathering.
I want to get the managed node CPU info and Memory info, from the above example debug is only printing either of the “{{ ansible_processor_vcpus }}” or “{{ ansible_memtotal_mb }}” but not both.