This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
Search the forum but could not find any awnsers to my question:
I'm trying to make a #kpi like this:
IF(Field A > Field B, Sum((Field C - Field D) * Field E))
Correction: IF((Field A > Field B, Sum((Field A - Field B)*Field C))
But i can't seem to get to right answer, can anybody help?
If all three fields are numeric, your expression should work with a sum() outside 'if' in KPI object, i.e.
Sum( If (A > B, ((A - B) * C)) )
If this is not working in KPI object, check if field C is being treated as text or not and correct that accordingly. Otherwise, try to share a sample app.
View solution in original post
I'm guessing you have many values in Field A and Field B? If so I think you're going to do an aggregation on those fields to use it in a KPI object. For example IF(Sum(Field A) > Sum(Field B), Sum((Field C - Field D) * Field E)).
Hope this helps.
If the another answer doesn't works, you could try
sum (if([Field A]>[Field B], ([Field C]-[Field D])*[Field E]))
Have you tried
sum(IF(Field A > Field B,
(Field C - Field D) * Field E
This doesn't work, Field A & Field B are numeric field (values range from 0 to 50)
Can you perhaps paste a short extract of your data with the expected output?
I wrote my formula wrong in my post earlier, here is an example piece.
If (A > B, ((A minus B) * C))
And then i want a total sum of all rows where A is bigger then B in a KPI.
Got the KPI working, thx a lot everbody for the quick respones!