Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a cyclic group and it has some of dimension such as KODYA,KECAMATAN,SUBBRANCH, and BRANCH.
This is my code in my expression :
if(YEAR_TRX = Max({<YEAR_TRX = {$(=Max(YEAR_TRX))}>} YEAR_TRX),
(Column(1) /
Aggr(NODISTINCT
Sum({$<ACTUAL_FLAG = {'*'} - {'0'}, ORG_ID = {'*'} - {'84'}>}
$(vActual)),
if(GetCurrentField("KecamatanGroup") = 'KECAMATAN', KODYA,
if(GetCurrentField("KecamatanGroup") = 'KODYA', SUBBRANCH,
if(GetCurrentField("KecamatanGroup") = 'SUBBRANCH', BRANCH,
if(GetCurrentField("KecamatanGroup") = 'BRANCH', BRANCH,
))))
)) * 100, 0)
Can someone explain to me why can't code work properly? This total result alwas 0.
I need to change my cyclic group "KecamatanGroup" so the value always be change.
Thanks
Hi
Try this
if(YEAR_TRX = Max({<YEAR_TRX = {$(=Max(YEAR_TRX))}>} YEAR_TRX),
(Column(1) /
Aggr(NODISTINCT
Sum({$<ACTUAL_FLAG = {'*'} - {'0'}, ORG_ID = {'*'} - {'84'}>}
$(vActual)),
$(=if(GetCurrentField("KecamatanGroup") = 'KECAMATAN', 'KODYA',
if(GetCurrentField("KecamatanGroup") = 'KODYA', 'SUBBRANCH',
if(GetCurrentField("KecamatanGroup") = 'SUBBRANCH', 'BRANCH',
if(GetCurrentField("KecamatanGroup") = 'BRANCH', 'BRANCH',
)))))
)) * 100, 0)
Darius
hi i dont think you can use a formula in the aggr part so try to replace
if(GetCurrentField("KecamatanGroup") = 'KECAMATAN', KODYA,
if(GetCurrentField("KecamatanGroup") = 'KODYA', SUBBRANCH,
if(GetCurrentField("KecamatanGroup") = 'SUBBRANCH', BRANCH,
if(GetCurrentField("KecamatanGroup") = 'BRANCH', BRANCH,
))))
with a variable which will hold the result of the formula above
Hi
Instead of using if statements with GetCurrentField function, just use group name.
if(YEAR_TRX = Max({<YEAR_TRX = {$(=Max(YEAR_TRX))}>} YEAR_TRX),
(Column(1) /
Aggr(NODISTINCT
Sum({$<ACTUAL_FLAG = {'*'} - {'0'}, ORG_ID = {'*'} - {'84'}>}
$(vActual)), group_name
)) * 100, 0)
I have use a variable but it can't work when i change dimension into cyclic.
vGroup =
if(GetCurrentField("KecamatanGroup") = 'KECAMATAN', KODYA,
if(GetCurrentField("KecamatanGroup") = 'KODYA', SUBBRANCH,
if(GetCurrentField("KecamatanGroup") = 'SUBBRANCH', BRANCH,
if(GetCurrentField("KecamatanGroup") = 'BRANCH', BRANCH,
))))
But when i change my Aggr function, it can't work.
Hi
Try this
if(YEAR_TRX = Max({<YEAR_TRX = {$(=Max(YEAR_TRX))}>} YEAR_TRX),
(Column(1) /
Aggr(NODISTINCT
Sum({$<ACTUAL_FLAG = {'*'} - {'0'}, ORG_ID = {'*'} - {'84'}>}
$(vActual)),
$(=if(GetCurrentField("KecamatanGroup") = 'KECAMATAN', 'KODYA',
if(GetCurrentField("KecamatanGroup") = 'KODYA', 'SUBBRANCH',
if(GetCurrentField("KecamatanGroup") = 'SUBBRANCH', 'BRANCH',
if(GetCurrentField("KecamatanGroup") = 'BRANCH', 'BRANCH',
)))))
)) * 100, 0)
Darius