Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
CostinelRO
Contributor II
Contributor II

Load only positive numbers in data load

Hello,

 

I am quite new to qlik and I want to do a sum on a column that has also negative numbers. But i want to calculate only positive numbers. From formula, i know i can use set analysis like this sum({< Value = {"<0"} >} Value)

But is there a way, to exclude them from the data load ? Instead of going into each graph and changing the formula ?

Something like :

load

column1,

column2,

column3

from table, where values > 0

 

Thanks in advance.

Labels (4)
5 Replies
Or
MVP
MVP

Yes, you can do that.

You can also Sum(RangeMax(Value,0)) on the front end rather than using a set.

CostinelRO
Contributor II
Contributor II
Author

Yes, but i have lots of graphs and columns. I was interested if there is a way to exclude negative numbers from data load. Just to avoid to change formulas everywhere

Or
MVP
MVP

You can do that in the data load editor, but this will impact everything. Up to you if you want to do it.

You shouldn't have that many formulas if you're using master items (and if you aren't, why not?), but the best solution is obviously up to you.

N30fyte
Creator
Creator

The following basic inline load script only loads the field rowname into the table no_negs when the value of rowval is greater than or equal to 0:

no_negs:
load*Inline [rowname,rowval
a,12
b,13
c,-4
d,22
e,-15
f,0
]

where rowval >=0;

 

Hope that gets you started...

marcus_sommer

I think I would implement a flag-field and using it as selection-possibility within the UI (which might be also locked). Such flag-creation would be quite easy with something like:

pick(sign(value) + 2, dual('negative', 1), dual('zero', 0), dual('positive', 1))

which could be then also applied within a set analysis or just as a boolean multiplicator.