Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

amit_saini
Honored Contributor 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
MVP
MVP

Re: Expression Issue Help !

Could you post your qvw with sample data?

Re: Expression Issue Help !

Try Calculated Dimension as below

Aggr(if(Month<>Month(today()),SubField(Defect_Description,'-',1)),Defect_Description)

Re: Expression Issue Help !

I would probably not use this kind of calculated dimension and adjust and/or split the field Defect_Description within the script and put the condition within the expression maybe like this:

Date = {"<date(monthstart(today(), 'YourFormat')"}

Further I would use rangesum(sum1, sum2) instead of sum1 + sum2 and maybe a further alt() to catch possible NULL or errors.

- Marcus

amit_saini
Honored Contributor III

Re: Expression Issue Help !

Hi Tresesco,

PFA

Thanks,

AS

amit_saini
Honored Contributor III

Re: Expression Issue Help !

Hi Manish,

Same issue

Thanks,

AS

Re: Expression Issue Help !

Does this look like something you want?

Capture.PNG

I added NODISTINCT to the expression:

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

amit_saini
Honored Contributor III

Re: Expression Issue Help !

Hi Sunny,

No!

Sum out of bars should be 97.

Thanks,

AS

Re: Expression Issue Help !

You mean if we sum all the bars it would total to 97?

amit_saini
Honored Contributor III

Re: Expression Issue Help !

Yes!

Community Browser