Dear support team,
I have separeted the month contents (for example 12.2017 or 01.2018 etc.) in my datebase in "Months" (01 or 02) and "Years" (2017, 2018) an created a pivot table which works fine with following code:
->pipe(new Map(array(
'{value}' => function($row, $metaData) {
$date = explode('.', $row['FakdatZBCP']);
$row['Year'] = $date[0];
$row['Month'] = $date[1];
return array($row);
},
'{meta}' => function($metaData) {
$metaData['columns']['Year'] = array(
'type' => 'number',
);
$metaData['columns']['Month'] = array(
'type' => 'number',
);
return $metaData;
}
)))
The following frontend view is now visible:
Now I would like to implement the following 3 steps where I need your support:
1) Mapping the "Month" digit values to the real months like 01=January, 02=February etc.
I've tried it with "ValueMap" code ater the Map above but no success!
->pipe(new ValueMap(array(
"Month" =>array(
"01"=>"January",
"02"=>"February",
"03"=>"March",
"{meta}"=>array(
"type"=>"string",
)
)
)))
2) As our business is not seperated into the calender year but in fiscal year I would like to sort the Month colums beginning with April end continue by May, June, July, August, September, October, November, December, January, February and finishes with March like in the excel screenshot below:
3) Last point is: I would like to add a separate column for each year which "cumulates" only the VALUE from the Month before like:
Any hints for me to implement these 3 points?
Kind regards,