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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Between values

Hi experts

the following expression doesn't work. Any ways to script this better or correct?

IF({<[counter] ={">-6"} and [counter] ={"<1"}>}
Sum([Value 1]) / Sum([Value2]))

 

Many thanks

Tom

1 Solution

Accepted Solutions
MayilVahanan

HI @TomBond77 

Try like below

Sum({<[value1] ={">0"}, [Year]={$(=max([Year])-1)} >}[value2])

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

6 Replies
Taoufiq_Zarra

@TomBond77  are you looking for ?

if([counter] >-6 and [counter] <1,Sum([Value 1]) / Sum([Value2]))

or

Sum({<[counter] ={">-6"} and [counter] ={"<1"}>}[Value 1]) / Sum({<[counter] ={">-6"} and [counter] ={"<1"}>} [Value2]))
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
MayilVahanan

HI @TomBond77 

Try like below

Sum({<[counter] ={">-6 <1"} >}[Value 1]) / Sum({<[counter] ={">-6 <1"} >}[Value2])

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=sum( {< [counter] = {">-6<1"} >} [Value 1] / [Value2] )

I hope it can helps.

Best regards
Andrea

TomBond77
Specialist
Specialist
Author

thanks, but I have to modify my script:

 

Sum({<[value1] ={">0"}>}
{<[Year]={$(=[Year]-1)} >}
[value2])

This one doesn't work, any ideas?

Many thanks

Tom

agigliotti
Partner - Champion
Partner - Champion

Hello @TomBond77 ,

What is the logic behind the expression?

MayilVahanan

HI @TomBond77 

Try like below

Sum({<[value1] ={">0"}, [Year]={$(=max([Year])-1)} >}[value2])

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.