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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QlikView formula error

Hi Guys,

Am facing formula error in QlikView if you see the image below I would give an idea

basically when its come to maths sum(A) - sum(B+C)  and sum(A) - sum(B) - sum(C) are output same value but

in QlikView I get two deference figures. can any one explain me why is this? for your reference I have attached an excel file

Thanks in advance!

error.jpg

Message was edited by: Mafaz Jaufer Please find the QVD attachment...

29 Replies
tresesco
MVP
MVP

To handle nulls, use rangesum(), like:

Rangesum(F2,-F3,-F4)

Or, for multiple values

Sum(Rangesum(F2,-F3,-F4))

PFA

Not applicable
Author

=rangesum(ALLOCATION) - (ACTUAL_SAH + PROJECTION)

=rangesum(ALLOCATION) - rangesum (ACTUAL_SAH) - rangesum(PROJECTION)

This is right?

tresesco
MVP
MVP

Nope! Try like:

=rangesum(ALLOCATION, -ACTUAL_SAH,-PROJECTION)

Not applicable
Author

no I get 0

but below sum gives me -2080198

=sum(ALLOCATION) - sum (ACTUAL_SAH) - sum(PROJECTION)

jonathandienst
Partner - Champion III
Partner - Champion III

Sum(rangesum(ALLOCATION, -ACTUAL_SAH,-PROJECTION))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tresesco
MVP
MVP

As I mentioned earlier(and been suggested by Jonathan) for multiple occurances, use sum() alongwith that. If even that doesn't help, you could share a sample qvw that demonstrates the issue.

Not applicable
Author

Please add me so that can send you the informations

tresesco
MVP
MVP

Why don't you attach here? if you are worried about data security, have a look here:Preparing examples for Upload - Reduction and D... | Qlik Community

Not applicable
Author



Hi, Kindly find the attachments. please help me


jagan
Partner - Champion III
Partner - Champion III

Hi,

Can you attach the actual file?  or the script of the table?  Assume that after join you have below table try like this

LOAD

*,

Alt(ALLOCATION, 0) AS ALLOCATION,

Alt(ACTUAL_SAH, 0) AS ACTUAL_SAH,

Alt (PROJECTION, 0) AS PROJECTION

FROM DataSource;

In the above script we handled the null values and convert it to zero.

Now you can straight away use

=sum(ALLOCATION) - sum (ACTUAL_SAH) - sum(PROJECTION)


OR

sum(ALLOCATION - ACTUAL_SAH  - PROJECTION)


both will return same values.


Hope this helps you.


Regards,

Jagan.