Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

% Issue Calculation

Hello all,

Below formula its working for only numbers, its not working for percentage.

please find the attached sample app,please help me

=num((CM-PM))/PM

Thanks in Advance

Niranjan

1 Solution

Accepted Solutions
rubenmarin

In the number formats of the 'PCT' types there is a "&'  '", PFA.

View solution in original post

9 Replies
rubenmarin

It's caused by the strings added to the numbers, if &'  ' is removed it starts to work.

NavinReddy
Creator II
Creator II
Author

Please help me where to remove the  if &' ', im not sure where to remove.

YoussefBelloum
Champion
Champion

there is an error on your expressions, this field don't exist: ELE_VALUE_DCML_CT

rubenmarin

In the number formats of the 'PCT' types there is a "&'  '", PFA.

NavinReddy
Creator II
Creator II
Author

Hi Ruben,

Thanks you very much its working, now i have to fileter only <=-50% and >=50%.

=IF((Percentage>=50% or Percentage<=-50%),Percentage,'NUll') -- with this code im getting only Null Values.

Need your help

Many thanks

NavinReddy
Creator II
Creator II
Author

i have to filter only <=-50% and >=50%. below expression is not working please help me


=IF((Percentage>=50% or Percentage<=-50%),Percentage,'NUll')

rubenmarin

You can try:

=If(Fabs((CM-PM)/PM)>=0.5, (CM-PM)/PM)

NavinReddy
Creator II
Creator II
Author

Thanks you very much Yes its working, just want to understand the logic.

rubenmarin

Fabs() returns the absolute value (always positive), the expression only checks if the absolute value is above or equal to 50% (0.5=50%), in that case it shows the percentage.