Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
publication1
Contributor III
Contributor III

Sum Error in expression nested aggregation not allowed

I have this in my set analysis:-

Count of Order_num = 635
Count of Order_num where PSTN = Yes = 257

 

Its doing the first part correct and showing 635 - 257 = 378
= Count(Order_Num) - Count { <,PSTN_PROVIDE={'Yes'}> }ORDER_NUM)

however when I say * 1084 like so,
= Count(Order_Num) - Count { <,PSTN_PROVIDE={'Yes'}> }ORDER_NUM) * 1084

the answer should be 409,752 however its showing as -277,953 which is incorrect

Labels (2)
6 Replies
MayilVahanan
MVP
MVP

Hi @publication1 

Try like below

=(Count(Order_Num) - Count ({ <PSTN_PROVIDE={'Yes'}> }ORDER_NUM)) * 1084

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
publication1
Contributor III
Contributor III
Author

I have tried however its still giving me a negative number.

=(Count ({ <PRODUCT_FAMILY={'EAD'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM))

/100

*3.1 - Count ({ <PRODUCT_FAMILY={'EAD'},PSTN_PROVIDE={'Yes'},A_END_MAIN_ROUTER_RQRD={'Y'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM) * 1084

publication1
Contributor III
Contributor III
Author

Can anyone give me a pointer on how to correctly set the below up. I have set analysis however its giving me a negative number and im sure its because it has to be in a different format

/* Expected orders */
=(Count ({ <PRODUCT_FAMILY={'EAD'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM)) /100 * 3.1

-
/* Actual orders */
Count ({ <PRODUCT_FAMILY={'EAD'},PSTN_PROVIDE={'Yes'},A_END_MAIN_ROUTER_RQRD={'Y'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM)

* 1084

the maths should be

635 - 257 = 378
Expected orders - Actual orders = Answer then Im needing Answer * 1084 to give me 409,752

Its currently giving me Minus -277,953

MayilVahanan
MVP
MVP

Hi,

Can you share the sample app

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
PradeepK
Creator II
Creator II

I suggest you to breakdown your problem into smaller parts and test it first.. i.e. Test Expected and Actual orders expressions separately. 

Keep note of operator precedence -> () , * ,  / , + ,  - 

Expression For Reference Only :

 

(
	( 
    	Count ({ <PRODUCT_FAMILY={'EAD'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM) / 100 
    ) * 3.1
)

-

(
	Count ({ <PRODUCT_FAMILY={'EAD'},PSTN_PROVIDE={'Yes'},A_END_MAIN_ROUTER_RQRD={'Y'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM) * 1084
)

 

 

Hope this helps.

publication1
Contributor III
Contributor III
Author

Finally got it - Was keen to get it sorted within the set analysis

 

=(Count ({ <PRODUCT_FAMILY={'EAD'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM)

/ 100 * 3.1 -

Count ({ <PRODUCT_FAMILY={'EAD'},PSTN_PROVIDE={'Yes'},A_END_MAIN_ROUTER_RQRD={'Y'},BANDWIDTH_MBITS={'0','10','100','1000'}> }ORDER_NUM))