Common calculation from two measurement without having two duplicate flux queries

I have two measurements say ‘a’ and ‘b’ which getting data from different sources but the fields are the same. Now I want to run a flux query that has some logic and it should run on both measurements ‘a’ and ‘b’. Is there any way I can do this without having two duplicate queries, it means the query which takes both table name one by one perform the operation.