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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Expression giving different Outputs

Hi Folks,

Below is my case , I'm using below same expression in 2 charts - different dimension ,bot not sure why the results are different.

=if(Line_Id='116',sum(ScheduledMinutes)+15,sum(ScheduledMinutes))/60

before it was sum(ScheduledMinutes)/60 , but I have to add addition 15 mints when Line_Id is 116.

Line_Name should be 37.9 instead of 37.3.

Please suggest what's wrong? Attached is sample app.

Regards,

AS

12 Replies
amit_saini
Master III
Master III
Author

Any Suggestions Sunny , Kaushik ???

Regards,

AS

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try including plant in aggr function.

=(Sum({<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Line_Name=>}Aggr(

Count(DISTINCT {<Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Line_Name=>}Day)*

Count(TOTAL <Facility_Id> DISTINCT {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Technology-={'No Fuel BM','No SCR inj'}>}Station_Label & Line_Name)*24, Facility_Id, Week,Plant))

-

Sum({<Month=,Week=,Day=,Shift_Name-={},Type_Name=,Standard_Name=,Why_Name=,Type={'PD'}>}Aggr(if(Line_Id='116',sum({<Month=,Week=,Day=,Shift_Name-={},Type_Name=,Standard_Name=,Why_Name=,Type={'PD'}>}ScheduledMinutes)+15,sum({<Month=,Week=,Day=,Shift_Name-={},Type_Name=,Standard_Name=,Why_Name=,Type={'PD'}>}ScheduledMinutes))/60,Station_Label,Week,Plant)))

/

Count( {$<Month=,Week=,Day=,Shift_Name-={},Quantity={"=Sum({<Month=,Week=,Day=>}Quantity) <> 0"},Type_Name = {'Downtime'}>} Quantity)

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
amit_saini
Master III
Master III
Author

Result is matching now by using below exp:

sum({<Month=,Week=,Day=,Date>}

Aggr(

Count(distinct {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Line_Name=>}Day)*

Count(TOTAL <Facility_Id>  DISTINCT {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Technology-={'No Fuel BM','No SCR inj'}>}Station_Label & Line_Name)*24, Week )

)

Thanks you so much Sunny and Kaushik for all your help!

Regards,

AS