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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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
MVP
MVP

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
MVP
MVP

@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
MVP
MVP

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
MVP
MVP

maybe this:

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

I hope it can helps.

Best regards
Andrea

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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
MVP
MVP

Hello @TomBond77 ,

What is the logic behind the expression?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
MayilVahanan
MVP
MVP

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.