Dec-04-2019, 02:12 PM
HI Team,
I get a json response of keys & values from api as below
'fm_data': {'LineofBusiness~PoleBranch~Region~MappedName~MappedNameSub~Owner~::~PMC~APAC~China~PMC-CHINA~PMC-CHINA~Leo Pan': {'aggregate': {'fc0_crm': 206000.0,
'fcn0_crm': 107000.0,
'fcn2_crm': 313000.0,
'fcPipe_crm': 50000.0},
'PMC ModSys': {'fc0_crm': 195000.0,
'fcn0_crm': 107000.0,
'fcn2_crm': 302000.0},
'PMC FI / PI': {'fc0_crm': 11000.0,
'fcn2_crm': 11000.0,
'fcPipe_crm': 50000.0}},
'LineofBusiness~PoleBranch~Region~MappedName~::~SME~APAC~India~SME-India': {'aggregate': {'fc0_crm': 622836.6,
'fcn0_crm': 213587.0,
'fcn2_crm': 622836.6},
'SME Electric': {'fc0_crm': 43300.3,
'fcn0_crm': 213587.0,
'fcn2_crm': 43300.3},
'SME Gas': {'fc0_crm': 579536.2,
'fcn0_crm': 214302.5,
'fcn2_crm': 579536.2}},
'LineofBusiness~PoleBranch~Region~MappedName~MappedNameSub~Owner~::~HTS~APAC~India~HTS-IND West~HTS-IND West~Vivekananda Majumder': {'aggregate': {'fcn0_crm': 100000.0,
'fcn2_crm': 100000.0},
'HTS ETO': {'fcn0_crm': 100000.0, 'fcn2_crm': 100000.0}},
'LineofBusiness~PoleBranch~Region~MappedName~::~HCP~AMER~CSAR~HCP-Andean/Caribbean': {'aggregate': {'fc0_crm': 522928.4,
'fcn0_crm': 248137.7,
'fcn2_crm': 788916.4,
'fcPipe_crm': 308597.7,
'fc8_crm': 17850.2},
'HCP Software': {'fc0_crm': 33922.2,
'fcn0_crm': 20000.0,
'fcn2_crm': 53922.2,
'fcPipe_crm': 300023.0},
'HCP Base': {'fc0_crm': 489006.2,
'fcn0_crm': 228137.7,
'fcn2_crm': 734994.1,
'fcPipe_crm': 8574.7,
'fc8_crm': 17850.2}}}
I need to get a output like(Delimeter is ~ & ~::~) which need to be separated to different column:
LineofBusiness PoleBranch Region MappedName MappedNameSub Owner LOB Type value
PMC APAC China PMC-CHINA PMC-CHINA Leo Pan
SME APAC India SME-India Null Null
.....
for each value as rows.
Thanks in advance.
I get a json response of keys & values from api as below
'fm_data': {'LineofBusiness~PoleBranch~Region~MappedName~MappedNameSub~Owner~::~PMC~APAC~China~PMC-CHINA~PMC-CHINA~Leo Pan': {'aggregate': {'fc0_crm': 206000.0,
'fcn0_crm': 107000.0,
'fcn2_crm': 313000.0,
'fcPipe_crm': 50000.0},
'PMC ModSys': {'fc0_crm': 195000.0,
'fcn0_crm': 107000.0,
'fcn2_crm': 302000.0},
'PMC FI / PI': {'fc0_crm': 11000.0,
'fcn2_crm': 11000.0,
'fcPipe_crm': 50000.0}},
'LineofBusiness~PoleBranch~Region~MappedName~::~SME~APAC~India~SME-India': {'aggregate': {'fc0_crm': 622836.6,
'fcn0_crm': 213587.0,
'fcn2_crm': 622836.6},
'SME Electric': {'fc0_crm': 43300.3,
'fcn0_crm': 213587.0,
'fcn2_crm': 43300.3},
'SME Gas': {'fc0_crm': 579536.2,
'fcn0_crm': 214302.5,
'fcn2_crm': 579536.2}},
'LineofBusiness~PoleBranch~Region~MappedName~MappedNameSub~Owner~::~HTS~APAC~India~HTS-IND West~HTS-IND West~Vivekananda Majumder': {'aggregate': {'fcn0_crm': 100000.0,
'fcn2_crm': 100000.0},
'HTS ETO': {'fcn0_crm': 100000.0, 'fcn2_crm': 100000.0}},
'LineofBusiness~PoleBranch~Region~MappedName~::~HCP~AMER~CSAR~HCP-Andean/Caribbean': {'aggregate': {'fc0_crm': 522928.4,
'fcn0_crm': 248137.7,
'fcn2_crm': 788916.4,
'fcPipe_crm': 308597.7,
'fc8_crm': 17850.2},
'HCP Software': {'fc0_crm': 33922.2,
'fcn0_crm': 20000.0,
'fcn2_crm': 53922.2,
'fcPipe_crm': 300023.0},
'HCP Base': {'fc0_crm': 489006.2,
'fcn0_crm': 228137.7,
'fcn2_crm': 734994.1,
'fcPipe_crm': 8574.7,
'fc8_crm': 17850.2}}}
I need to get a output like(Delimeter is ~ & ~::~) which need to be separated to different column:
LineofBusiness PoleBranch Region MappedName MappedNameSub Owner LOB Type value
PMC APAC China PMC-CHINA PMC-CHINA Leo Pan
SME APAC India SME-India Null Null
.....
for each value as rows.
Thanks in advance.