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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

Print 0 when get negative values in Front End

Dear Folks,

i have the below expression and I want to print 0 when values is negative.

Expression : Sum({<NumDateKey={">=$(=vFromDate)<=$(=vToDate)"}>} [9LE Bulk Vol])


If above Expression gives -16.5 or 0 then show me 0 else show me actual value or 1.

I can Achieve this by using  below expression. But i dont want to use If function as it will take long time to process the data in front end end. I wanted to achieve this without If condition...

If( Sum({<NumDateKey={">=$(=vFromDate)<=$(=vToDate)"}>} [9LE Bulk Vol])  <=0,0,1)



Also, I can't do it in back end also like below because it is running on dynamic date selection based on user input

If(  [9LE Bulk Vol] <=0,0,1)



Suppose user Select 15-04-2018  then  from_date and To_date is calculated like below . And every time user will select different date and based on that user input the expression will give the result and on that result we have to implement if negative value then 0 else 1.  

From_date = (15-04-2018) -91  = 14-01-2018

To_date =  15-04-2018


So expression becomes like this

Sum({<NumDateKey={">=(14-01-2018)<=(15-04-2018)"}>} [9LE Bulk Vol])



Can anybody tell me how we can achieve whithout If condition in front end . help would be much appreciated.

Thanks

Sarfaraz



0 Replies