Using the LSEG Data Library for Python (Desktop session), I am able to retrieve numeric business segment data such as TR.SegmentRevenueActValue for Japanese listed companies. However, the returned DataFrame only contains numeric values and does not include:
- The business segment name
- The fiscal period or period end date associated with each value
For example, the following code returns numbers but no segment metadata:
import lseg.data as ld
ld.open_session()
df = ld.get_data(
universe=['7203.T'],
fields=[
'TR.SegmentRevenueActValue',
'TR.SegmentOpProfitActValue',
'TR.SegmentEBITDAActValue'
],
parameters={
'SDate': 'FY-2',
'EDate': 'FY0',
'Frq': 'FY'
}
)
print(df)
Questions:
- What is the correct field or sub-property to retrieve the business segment name associated with each segment value?
- What is the correct way to include the fiscal period or period end date per row?
- Is there a recommended approach to reshape the output so that each row represents one:
- Company (RIC)
- Fiscal period (annual or quarterly)
- Business segment
Target Output:
One row per (RIC, fiscal year or fiscal quarter, business segment) including, where available:
- RIC
- Period end date
- Business segment name
- Segment revenue
- Segment operating profit
- Segment EBITDA
- Segment assets
- Segment depreciation
My goal is simply to download business segment data for both annual and quarterly periods with full segment context.
Thank you for your assistance.