@kumargaurav if your index A only has Username which you want to correlate with lookup X.csv to get the Company/Facility information, then you would need to create Lookup Definition from Settings > Lookups . Assuming lookup definition is X try the following search:
index=A Username=*
| lookup X Username
| search Company="A" AND Company="B"
| stats count by Username Facility
Please try out and confirm.
... View more