How to Filter Data Display in Pop-up

Hi! There!

I am using two pop-up windows. The two pop-ups are interrelated. What I want to do is to filter the values to be loaded/displayed in Pop-up #2 based on the selected value in Pop-up #1. I assigned the Pop-up #1 selected value to a variable, however, I could not use this as a parameter in the aggregate I created in Pop-up #2's preparation. Can someone help me, please. Or if you have sample applications having this scenario, please share. Thanks.