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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do you write an expression with a modifier between x and y values?

Hi

=sum({1<Area={'UK'}, Contractor={0},Op_Week={">=$(=$(vMaxCompleteOpWk)-4)"} >} [Issued])

/sum({1<Area={'UK'}, SubcontractorType={0},Op_Week={">=$($(=vMaxCompleteOpWk)-4)"}>}  Declared)

I am trying to write an expression based on the one below to return data where the Op_Week is between vMaxCompleteOpWk and vMaxCompleteOpWk-4.  Any help would be welcome

Thanks

4 Replies
chematos
Specialist II
Specialist II

try this,

=sum({1<Area={'UK'}, Contractor={0},Op_Week={'$(<=$(vMaxCompleteOpWk))'},

Op_Week={'$(>=$(vMaxCompleteOpWk)-4)'} >} [Issued])

/sum({1<Area={'UK'}, SubcontractorType={0},Op_Week={'$(<=$(vMaxCompleteOpWk))'},Op_Week={'$(>=$(vMaxCompleteOpWk)-4)'}>}  Declared)

Hope this helps

Regards,

Chema

Not applicable
Author

Hi Chema

Thank you for your help. Unfortunately the expression did not return any results .

Regards

K

Not applicable
Author

Hi Chema

Think I have the solution

=sum({1<Area={'UK'}, Contractor={0},Op_Week={">=$(=$(vMaxCompleteOpWk)-4)"} *{"<=$(=$(vMaxCompleteOpWk))"} >} [Issued])/sum({1<Area={'UK'}, SubcontractorType={0},Op_Week={">=$($(=vMaxCompleteOpWk)-4)"} *{"<=$(=$(vMaxCompleteOpWk))"}>}  Declared)


Regards

K

chematos
Specialist II
Specialist II

Hi kathryn,

I´m glad you get this! I knew it was something like that but usually when you use a comma ',' that must do a logic AND, but I´m seeing that sometimes the solution is with '*' like you did.

Regards,

Chema