PivotTable display behavior

I have a pivotTable where I have the following query and it works just fine.

select e.planDate, e.quantity, e.company, e.demandSupplyIndicator, e.material, e.plant, EXTRACT(YEAR FROM e.planDate), EXTRACT(MONTH FROM e.planDate) from erp$DemandSupplyPlanDetail e

The outcome is as follows:
58%20AM

When I change the Query to display the PivotTable as follows:
select e.planDate, e.quantity, e.company, e.demandSupplyIndicator, e.material, e.plant, EXTRACT(YEAR FROM e.planDate), EXTRACT(MONTH FROM e.planDate) from erp$DemandSupplyPlanDetail e where e.material.id = :ds$materialsDs.id

This displays initially as follows:

That I refresh as follows:
11%20AM

and when I refresh with custom parameter and repaint the pivot table, it doesn’t display the details as follows:
35%20AM

I used the following code to refresh:

 @Override
public void init(Map<String, Object> params) {
        materialsDs.addItemChangeListener(e -> {
       demandSupplyPlanDetailsDs.refresh(ParamsMap.of("materialId", e.getItem().getId()));
        pivotTable.repaint();
    });
    super.init(params);
}   

what could be a fix to have the detail data displayed for the selected material similar to the first image where I don’t need to rearrange the fields manually?

Hi,

Could you please attach a demo project with sample data? For now, it’s difficult to suggest something.

Regards,
Gleb

Hi Gleb
Thanks but I’m not sure if a demo app will do the same!