MATRIX CONNECTOR MULTI YEAR LOAD
- 3 years ago
i resolved this by writing a union sql.
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M1') as 'Time' , Jan as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M2') as 'Time', Feb as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M3') as 'Time', Mar as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M4') as 'Time' , Apr as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M5') as 'Time', May as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M6') as 'Time', Jun as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M7') as 'Time', Jul as 'Amount'from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M8') as 'Time', Aug as 'Amount'from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M9') as 'Time' , Sep as 'Amount'from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M10') as 'Time', Oct as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M11') as 'Time' , Nov as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'
UNION ALL
Select RegisterID,Entity,Account,CONCAT(WFTimeName,'M12') as 'Time' , Dec as 'Amount'
from XFC_PLP_Forecast where WFScenarioName = '4_32_Forecast'