13 Replies Latest reply: Sep 18, 2015 2:55 AM by Amit Saini

# Script Help???

Hi Folks ,

Below is my expression :

Sum({<Complaint_Acceptance-={'4','5','6','7'}>} QTY_PPM*Top_Pos_Flag)/if(Complaint_Type=3 or Complaint_Type=1, Sum (QTY_Delivered_TOTAL),if(Complaint_Type=2 or Complaint_Type=7, Sum (QTY_Received_TOTAL), 0))

*1000000

I'm calling a bar chart with Month as Dimension , but I'm getting "no data displayed value" when I'm calling above expression.

Not sure If my expression is correct or not?

Kindly suggest!

Thanks

AS

• ###### Re: Script Help???

Are you multiplying 1000000 with the whole or denominator only? Please verify.

• ###### Re: Script Help???

with Whole

• ###### Re: Script Help???

But currently it is multiplying with denominator only, try this to multiply to whole -

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

if(Complaint_Type=3 or Complaint_Type=1, Sum (QTY_Delivered_TOTAL),if(Complaint_Type=2 or Complaint_Type=7, Sum (QTY_Received_TOTAL), 0)))*1000000

• ###### Re: Script Help???

Made mistake, you may need bracket before Sum..

• ###### Re: Script Help???

try this

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

(alt(pick(match(Complaint_Type,'3','1','2','7'),

Sum (QTY_Delivered_TOTAL),Sum (QTY_Delivered_TOTAL), Sum (QTY_Received_TOTAL), Sum (QTY_Received_TOTAL)),0)

*1000000)

• ###### Re: Script Help???

Sorry Kush same issue!

Thanks,
AS

• ###### Re: Script Help???

Can you please attach your sample application.

• ###### Re: Script Help???

try this

=(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

• ###### Re: Script Help???

I would separately put the expressions in a text object and see whats going on

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

if(Complaint_Type=3 or Complaint_Type=1, Sum (QTY_Delivered_TOTAL),if(Complaint_Type=2 or Complaint_Type=7, Sum (QTY_Received_TOTAL), 0))

hth

Sasi

• ###### Re: Script Help???

Sasidhar,

I have already tried this , upper part alone is working fine but below part always showing me zero.

Thanks,

AS

• ###### Re: Script Help???

Hi,

did you check that there is value for complaint type 1,3,2,7

also if it none of the above then you want to divide it by 0 or 1.

If possible share your sample app.

Regards

• ###### Re: Script Help???

Max,

Here is the attachment.

Thanks,

AS

• ###### Re: Script Help???

Break it down into parts. But I expect the problem is due to the fact that you have more than one possible value of Complaint_Type for each row.

So check that

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

works correctly. Then check the divisor

=if(Complaint_Type=3 or Complaint_Type=1, Sum (QTY_Delivered_TOTAL),if(Complaint_Type=2 or Complaint_Type=7, Sum (QTY_Received_TOTAL), 0))

I dont think this is working.

As an alternative (to remove the naked references to Complaint_Type)

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