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

Aggr taking time in Stacked Bar Chart

Hi Folks,

I'm using below exp in a Stacked bar chart:

=Sum({<Month=,Week=,Why_Name=,Standard_Name=,Area_Name=,Product_Name=,Variant_Name=,Reason_Name=>}Aggr(if(match(Line_Id,'124','116')

,sum({<Month=,Week=,Why_Name=,Standard_Name=,Area_Name=,Product_Name=,Variant_Name=,Reason_Name=>} ScheduledMinutes)+avg({<Month=,Week=,Why_Name=,Standard_Name=,Area_Name=,Product_Name=,Variant_Name=,Reason_Name=>}15),

sum({<Month=,Week=,Why_Name=,Standard_Name=,Area_Name=,Product_Name=,Variant_Name=,Reason_Name=>}ScheduledMinutes))/60,Station_Label,Reason_Planned_Downtime,Week))

Dimm are :

1. Week

2. Reason_Planned_Downtime


Currently , it is taking around 40-50 sec to load the chart , any suggestions to reduce the load time???

In general , what I'm trying is : if(match(Line_Id,'124','116'), ScheduledMinutes+15 ,ScheduledMinutes)/60

Thanks,

AS


13 Replies
YoussefBelloum
Champion
Champion

Hi,

maybe replace the the if match inside the set analysis, like this:

{<...,Line_Id={'124','116'}>}

amit_saini
Master III
Master III
Author

Hi,

Based on this "if" itself , we have two conditions , if I bring this within set the my expression is wrong.

Can u share full exp , what u meant?

Thanks,

AS

YoussefBelloum
Champion
Champion

My bad, you're right.. didn't pay enough attention to the entire post

amit_saini
Master III
Master III
Author

np

YoussefBelloum
Champion
Champion

maybe Valuelist() function can help you

jonathandienst
Partner - Champion III
Partner - Champion III

Aggr() is expensive to calculate. Do you really need it here? Did you try

if(match(Line_Id,'124','116'),

    sum({<Month=,Week=,Why_Name=,Standard_Name=,Area_Name=,Product_Name=,Variant_Name=,Reason_Name=>} ScheduledMinutes) + 15,

    sum({<Month=,Week=,Why_Name=,Standard_Name=,Area_Name=,Product_Name=,Variant_Name=,Reason_Name=>} ScheduledMinutes) / 60

)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
andrey_krylov
Specialist
Specialist

Hi, Amit. Very interesting... try to test the expression in parts. Once I came across the fact that Pick() function in dimension and expression took several minutes and after replacing with simple IF(), everything was fine.

amit_saini
Master III
Master III
Author

Hi Jonathan,

Yes, in starting I was using the same expression , but then I found if I'm using the same expression with Different Dimension like Station_Label or Reason_Planned_Downtime or Week different output , but when I used Aggr() results across all Charts was same.


Thanks,

AS

amit_saini
Master III
Master III
Author

Hi Andrey,

Yes, my Aggr part is the issue , if I remove it than calculation is super fast.

Thanks,

AS