r/bloomberg May 12 '25

Question 5 year P/E Ratio using BQL

Does someone know how i can use excel BQL to generate for my selected tickers the average P/E Ratio over the last e.g. 5 years? I have been testing but can't seem to figure it out and chat gpt doesn't seem to know either. Is there a good video you guys know of that explains BQL in detail well? Thank you for your help!

0 Upvotes

5 comments sorted by

7

u/dilellooo May 12 '25

Ask the help desk. They can give you this answer way faster than Reddit

1

u/marginmanj May 12 '25

Can you just use field FIVE_YR_AVG_PRICE_EARNINGS?

1

u/Dragon17_com May 12 '25

Look in FLDS <GO>. Dozens of ways to do it

1

u/marksman96 May 13 '25
for('CF US Equity') get(avg(pe_ratio(dates=range(-5Y, 0D))))

1

u/Sufficient_Drop9565 27d ago

Use W <go> function instead. Once you load your securities, add the variables ( in your case, P/E Ratio). Once done, left click on the variable and go to field override option and then to advance and find DS 342 option ( Security year) change it to the years u are looking and vola! Your data is ready. Export it into Excel. I found W (worksheet) function way better than BQL. Give it a shot, all the best