Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

darkshadow91223
New Contributor

How to separate -ve and +ve values in straight table

I did a expresion to give me the difference in percentage between 2 same values to see how much it change. i want to visualize positive percentage values in one table and negative in the other one.


The expression that im using is this:


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


Any ideas?.


3 Replies
devarasu07
Honored Contributor II

Re: How to separate -ve and +ve values in straight table

Hi,

you can try like below


for -ve:

if(

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

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


for +ve ;

if(

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

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


Thanks,Deva

Re: How to separate -ve and +ve values in straight table

You can call like this?

+ve

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


-ve

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

omarbensalem
Esteemed Contributor

Re: How to separate -ve and +ve values in straight table

and then under adds on; uncheck show zero values