Hi team sharing client's query
when using the LSEG API, I have noticed that whether I download a certain field for "FQ", or "CQ", the values are different, even for firms where the fiscal year end is 31/12, so fiscal and calendar quarters should align (as far as I understand). Do you have any idea why that might be occurring? Many thanks in advance.
Client provided the script but upon running in codebook, i encountered an error.
Here is the code I was running. I found that ENI.MI and PSHG_p.DE had different values for the same quarter, depending on whether fq or cq was considered
start=2024
end=2025
sample=['PSHG_p.DE','ENI.MI','SASY.PA','ADSGn.DE','SAPG.DE','NOVOb.CO']
fields=['TR.F.MKTCAP','TR.F.MKTCAP.date']
quarters = []
for i in range(start, end + 1):
for j in range(1, 5):
quarters.append(str(j) + 'FQ' + str(i))
quarters.append(str(j) + 'CQ' + str(i))
failed_df = pd.DataFrame()
b_sheet = pd.DataFrame()
for q in quarters:
attempts = 0
while attempts <= 3:
try:
data = ld.get_data(sample, fields, parameters={'Period': q})
data['Date'] = q
b_sheet = pd.concat([b_sheet, data], axis=0, ignore_index=True)
break
except:
print(f'error at {q},at attempt {attempts}')
attempts += 1
if attempts == 3:
failed_df['Date'] = q