idid=ididNcategorycategoryYhistory_datehistory_dateYlast_yearlast_yearYthis_yearthis_yearYtargettargetYtrx_last_yeartrx_last_yearYtrx_this_yeartrx_this_yearYgrowth_valuegrowth_valueYachv_targetachv_targetYgrowth_trxgrowth_trxYgrowth_value_fullgrowth_value_fullY624384YMerge joinMergeJoinY1noneLEFT OUTERSort rowsSort rows 2idproduct_category_id352288YMerge join 2MergeJoinY1noneLEFT OUTERMerge joinSort rows 3idproduct_category_id496288YMerge join 3MergeJoinY1noneLEFT OUTERMerge join 2Sort rows 4idid624288YMerge join 4MergeJoinY1noneLEFT OUTERMerge join 3Sort rows 5idproduct_category_id752288YMerge join 5MergeJoinN1noneLEFT OUTERMerge join 4Sort rows 6idproduct_category_id864288YMerge join 6MergeJoinY1noneLEFT OUTERMerge join 5Sort rows 7idproduct_category_id992288YSelect valuesSelectValuesY1noneidcategoryhistory_datelast_yearthis_yeartargettrx_last_yeartrx_this_yearlast_year_fullN992384YSelect values 2SelectValuesY1noneidcategoryhistory_datelast_yearthis_yeartargettrx_last_yeartrx_this_yeargrowth_valueachv_targetgrowth_trxgrowth_value_fullN752384YSort rowsSortRowsY1none%%java.io.tmpdir%%out1000000NNidYNN0N256288YSort rows 2SortRowsY1none%%java.io.tmpdir%%out1000000NNproduct_category_idYNN0N352208YSort rows 3SortRowsY1none%%java.io.tmpdir%%out1000000NNproduct_category_idYNN0N496208YSort rows 4SortRowsY1none%%java.io.tmpdir%%out1000000NNidYNN0N624208YSort rows 5SortRowsY1none%%java.io.tmpdir%%out1000000NNproduct_category_idYNN0N752208YSort rows 6SortRowsY1none%%java.io.tmpdir%%out1000000NNproduct_category_idYNN0N864208YSort rows 7SortRowsY1none%%java.io.tmpdir%%out1000000NNproduct_category_idYNN0N992208Ycategory targetTableInputY1nonedw bi indoteknikselect * from category_target0NNNNIntegernormalid90Table inputid####0;-####0.,noneNY0NNNen_USAsia/BangkokNStringnormalname2147483647-1Table inputname.,noneNY0NNNen_USAsia/BangkokNBigNumbernormaltarget-1-1Table inputtarget######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokN624112Ylast yearTableInputY1nonedw bi indoteknikselect coalesce(p.parent_category_id, 999999) as product_category_id, sum(aml.price_subtotal) as last_year
from account_move_line aml
join product p on p.product_id = aml.product_id
join account_move am on am.id = aml.move_id
where 1=1
and aml.parent_state = 'posted'
and am.move_type = 'out_invoice'
and aml.date between to_timestamp(get_first_day_last_year(), 'YYYY-MM-DD') and to_timestamp(get_now_last_year(), 'YYYY-MM-DD')
group by p.parent_category_id0NNNNIntegernormalproduct_category_id90last yearproduct_category_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNBigNumbernormallast_year-1-1last yearlast_year######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokN352112Ylast year fullTableInputY1nonedw bi indoteknikselect coalesce(p.parent_category_id, 999999) as product_category_id, sum(aml.price_subtotal) as last_year_full
from account_move_line aml
join product p on p.product_id = aml.product_id
join account_move am on am.id = aml.move_id
where 1=1
and aml.parent_state = 'posted'
and am.move_type = 'out_invoice'
and to_char(aml.date, 'YYYY') = get_last_year()
group by p.parent_category_id0NNNNIntegernormalproduct_category_id90last year fullproduct_category_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNBigNumbernormallast_year_full-1-1last year fulllast_year_full######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokN992112Yparent categoryTableInputY1noneerp indoteknik productionselect id, category, now()::timestamp-'7 hours'::interval as history_date
from(
select ppc.id, name as category
from product_public_category ppc
where ppc.id in(
2040,
2097,
2161,
2222,
2246,
2273,
2315,
2354,
2394,
2420,
2477,
2445
)
union
select 999999, 'Others'
)a order by id0NNNNIntegernormalid90parent categoryid####0;-####0.,noneNY0NNNen_USAsia/BangkokNStringnormalcategory2147483647-1parent categorycategory.,noneNY0NNNen_USAsia/BangkokN160288Ythis yearTableInputY1nonedw bi indoteknikselect coalesce(p.parent_category_id, 999999) as product_category_id, sum(aml.price_subtotal) as this_year
from account_move_line aml
join product p on p.product_id = aml.product_id
join account_move am on am.id = aml.move_id
where 1=1
and aml.parent_state = 'posted'
and am.move_type = 'out_invoice'
and to_char(aml.date, 'YYYY') = get_now_year()
group by p.parent_category_id0NNNNIntegernormalproduct_category_id90this yearproduct_category_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNBigNumbernormalthis_year-1-1this yearthis_year######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokN496112Ytrx last yearTableInputY1nonedw bi indoteknikselect coalesce(p.parent_category_id, 999999) as product_category_id, count(distinct aml.move_id) as trx_last_year
from account_move_line aml
join product p on p.product_id = aml.product_id
join account_move am on am.id = aml.move_id
where 1=1
and aml.parent_state = 'posted'
and am.move_type = 'out_invoice'
and aml.date between to_timestamp(get_first_day_last_year(), 'YYYY-MM-DD') and to_timestamp(get_now_last_year(), 'YYYY-MM-DD')
group by p.parent_category_id0NNNNIntegernormalproduct_category_id90trx last yearproduct_category_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNIntegernormaltrx_last_year150trx last yeartrx_last_year####0;-####0.,noneNY0NNNen_USAsia/BangkokN752112Ytrx this yearTableInputY1nonedw bi indoteknikselect coalesce(p.parent_category_id, 999999) as product_category_id, count(distinct aml.move_id) as trx_this_year
from account_move_line aml
join product p on p.product_id = aml.product_id
join account_move am on am.id = aml.move_id
where 1=1
and aml.parent_state = 'posted'
and am.move_type = 'out_invoice'
and to_char(aml.date, 'YYYY') = get_now_year()
group by p.parent_category_id0NNNNIntegernormalproduct_category_id90trx this yearproduct_category_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNIntegernormaltrx_this_year150trx this yeartrx_this_year####0;-####0.,noneNY0NNNen_USAsia/BangkokN864112YN