Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
vchuprina
Specialist
Specialist

Expression optimization

Hi,

I'm trying to make optimization of expression in one application, right now it looks like this:

sum(aggr(if($(vFilter),sum([Estimated labor hours]),0), [Key]))

where vFilter is:

(len(trim(MaxString([Request Number])))>0
or
len(trim(MaxString([Agreement number])))>0)
and
(
(num(Left(PurgeChar(MaxString([TECO Date]),'-'),6))<=max(num([Year Month]))
and
num(Left(PurgeChar(MaxString([TECO Date]),'-'),6))>=min(num([Year Month])))
or
(num(Left(PurgeChar(MaxString([Invoice Date]),'-'),6))<=max(num([Year Month]))
and
num(Left(PurgeChar(MaxString([Invoice Date]),'-'),6))>=min(num([Year Month])))
)

Do you have any ideas?

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
Labels (3)
1 Reply
rubenmarin

Hi, I suppose there will be a relation so each row of [Estimated labor hours] has related to one (or none) Request Number, agreement number, TECO date and Invoice date. If this is true, you can add a flag to each [Estimated labor hours] so youly need "Sum({<flag={1}>} [Estimated labor hours])

If this is not possible, at least try to add flags for the len(trim(...)) checks, and add fields in each estimated labor hours to have num(Left(PurgeChar(MaxString([TECO Date]),'-'),6)) as assigneTECODate, and the same with the other date to allow do the camparison with this precalcualted fields.