Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Expression Issue Help !

Ho Folks,

I'm not sure if this is because of my data model , but I'm facing issue with below bar chart.

Instead of showing all Defect_Desc. , bar is only showing "Appearance".

Dimension: =if(Month<>Month(today()),SubField(Defect_Description,'-',1))

Expression:

sum(aggr(Sum({<Complaint_Acceptance-={4,5,6,7}>} QTY_PPM*Top_Pos_Flag) /

(Sum ({<Complaint_Type = {1, 3}>} QTY_Delivered_TOTAL) + Sum ({<Complaint_Type = {2, 7}>} QTY_Received_TOTAL)) *1000000,%MANDANT_Key))

Kindly help!

Thanks,

AS

16 Replies
sunny_talwar

The output is what you want, but not sure if this will continue to work with selections. I will let you test it on your end:

Capture.PNG

Expression:

Avg(Aggr(NODISTINCT Sum({<Complaint_Acceptance-={4,5,6,7}>} QTY_PPM*Top_Pos_Flag) /

(Sum ({<Complaint_Type = {1, 3}>} QTY_Delivered_TOTAL) + Sum ({<Complaint_Type = {2, 7}>} QTY_Received_TOTAL)) *1000000,%MANDANT_Key))

Not applicable

Try this:

Sum({<Complaint_Acceptance-={4,5,6,7}>} QTY_PPM*Top_Pos_Flag)

/ (Sum ({<Complaint_Type = {1, 3}>} total QTY_Delivered_TOTAL) + Sum ({<Complaint_Type = {2, 7}>} total QTY_Received_TOTAL)) *1000000

Image Home 175.jpg

Not applicable

Aggr is very sensitive - it will put all the answer into first occured dimension if this dimension is not in it's dims list. Also Aggr produses huge impact on perfomance. Try to avoid it. the same impact also is produced by the calculated dimensions. Here your dimension can be simply transformed into additional Set Analysis like $*1<Month-={"=Month(Today(1))"}> and make in model your second part (subfield) of the dimension precalculated.

amit_saini
Master III
Master III
Author

Sorry Sunny, what I'm looking here is to get overall sum as 97 from all bars like "Assembly" ,Damaged Component, Customer Dis.....etc

Thanks,

AS

sunny_talwar

Hahahaha yes you are right, I am an idiot. I will re-look at it

sunny_talwar

This?

Capture.PNG

Expression:

Sum(aggr(NODISTINCT Sum({<Complaint_Acceptance-={4,5,6,7}>} QTY_PPM*Top_Pos_Flag),%MANDANT_Key))/

(Sum(TOTAL <[%MANDANT_Key]> Aggr(NODISTINCT Sum ({<Complaint_Type = {1, 3}>} QTY_Delivered_TOTAL), %MANDANT_Key)) +

Sum(TOTAL <[%MANDANT_Key]> Aggr(NODISTINCT Sum ({<Complaint_Type = {2, 7}>} QTY_Received_TOTAL), %MANDANT_Key))) * 1000000

amit_saini
Master III
Master III
Author

Sunny ,

This calculation is working fine when I'm selecting any individual plant , but overall this is not working 100%

Example : All these 6 plants comes under "NA" , so if you are selecting any one of these plants then ur expression is working fine, but in case of overall NA =372 , calculates sum from ur expression is not equal to 372.

Thanks,

AS