Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
darkshadow91223
New Contributor III

Exclude negative and positive values from expression

Hi,

I have the expression to calculate difference.

But i only want to show negative difference (Value) also excluding positives values in the calculation. and then vice versa (show +ve, exclude -ve)

Num(1 - Sum({<TimeStamp={'Old'}>}Amount) / Sum({<TimeStamp={'New'}>}Amount), '#,###.#0%')


How do i do this?

Any help please?


Num(1 - (Sum({<TimeStamp={'Old'}>}Amount) / Sum({<TimeStamp={'New'}>}Amount))<0, '#,###.#0%')

Thank you!

3 Replies

Re: Exclude negative and positive values from expression

May be this

Positive Values

Num(RangeMax(1 - Sum({<TimeStamp={'Old'}>}Amount) / Sum({<TimeStamp={'New'}>}Amount), 0), '#,###.#0%')


Negative Values

Num(RangeMin(1 - Sum({<TimeStamp={'Old'}>}Amount) / Sum({<TimeStamp={'New'}>}Amount), 0), '#,###.#0%')

darkshadow91223
New Contributor III

Re: Exclude negative and positive values from expression

Thank you! it works!!

Re: Exclude negative and positive values from expression

Awesome, please close the thread by marking the correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny