I have a table where it needs to be repeated whenever there is a value 1 in A column D2 number of times as shown
I have tried with =QUERY(A1:D7,"select C,B where A=1")
https://docs.google.com/spreadsheets/d/1B4261XqXBbAQs8vHAyg40TeCvo8qFxZ9AIPezmN2yjc/copy
Prefer to have a single long formula that can accomplish.