Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mariadevlin25
Contributor
Contributor

Chart Cyclic Group % Expression Issue

I am having trouble with an expression in a chart cyclic group not aggregating correctly in the chart at all levels of the drill down. Note that my EBIT $ aggregates fine at all levels but the EBIT % does not. I have this data in a table as well and the parts of the expression are the same and works fine at all levels of drill down. Only difference is the field names are referenced. Does anyone have a suggestion?

 

expression:

EBIT%

//([Revenue] - [COS $] - ( [Total R&D] + [Total S&M]+ [Total G&A]) - [OIE])/ [Revenue]
=
((
Num(((SUM({$<Category={"Sell-In Revenue","Sell-Thru Adj"}>} Period_Net *Ratio)*(-1))/%_Divider),'#,##0.0')
)
-

(

sum(aggr(
if(
Num(
sum( aggr(
(

SUM(TOTAL<PAL2_CD,YYYYMM, Period_YYYYQQ>{$<Category={'Input Cost', 'Invty Cost','WWS COS'},Market=,[Reported Market]=>} Period_Net)

/
SUM(TOTAL<PAL2_CD,YYYYMM, Period_YYYYQQ>{$<Market=,[Reported Market]=>}BillQty*STD_COST))
*
sum(BillQty*STD_COST) ,PAL2_CD,Period_YYYYQQ,Market,[Reported Market],Period_YYYYMM))

/%_Divider, '#,##0.0')=0,

//sum(aggr(Num(((SUM({$<Category={"Mfg Variance", "WWS COS"}>} Period_Net *Ratio))/%_Divider),'#,##0.0'), PAL2_CD,YYYYMM, Period_YYYYQQ))
sum(aggr(


Num(((SUM({$<Category={"Mfg Variance", "WWS COS"}>} Period_Net *Ratio))/%_Divider),'#,##0.0')

,PAL2_CD,Period_YYYYQQ,Market,[Reported Market]))
,
Num(
sum( aggr(
(

SUM(TOTAL<PAL2_CD,YYYYMM, Period_YYYYQQ>{$<Category={'Input Cost', 'Invty Cost','WWS COS'},Market=,[Reported Market]=>} Period_Net)

/
SUM(TOTAL<PAL2_CD,YYYYMM, Period_YYYYQQ>{$<Market=,[Reported Market]=>}BillQty*STD_COST))
*
sum(BillQty*STD_COST) ,PAL2_CD,Period_YYYYQQ,Market,[Reported Market],Period_YYYYMM))

/%_Divider, '#,##0.0')) ,PAL2_CD,YYYYMM, Period_YYYYQQ,Market,[Reported Market]))
)

-
(
Num(((SUM({$<Category={"BU R&D","Corp R&D"}>}Period_Net*Ratio))/%_Divider),'#,##0.0')
+

Num(((SUM({$<Category={"BU S&M","Corp S&M"}>}Period_Net*Ratio))/%_Divider),'#,##0.0')
+
Num(((SUM({$<Category={"BU G&A","Corp G&A"}>}Period_Net*Ratio))/%_Divider),'#,##0.0'))

-
(
Num(((SUM({$<Category={"OTHER (Net FX/Oth G/L)"}>}Period_Net*Ratio))/%_Divider),'#,##0.0')

)

)

/

(Num(((SUM({$<Category={"Sell-In Revenue","Sell-Thru Adj"}>} Period_Net *Ratio)*(-1))/%_Divider),'#,##0.0'))

1 Reply
Brett_Bleess
Former Employee
Former Employee

Best I have is the following Design Blog post that may be of some help.  My post will kick this back out, since you posted on a Saturday, a lot of folks may not have seen things, so this will give them a chance to follow-up, so someone else may have something better for you:

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Community Browser