Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
srini
Contributor

Subtract not working in expression...

I have expression, as follows

 

=if([Cycle Name]='FORECAST',[Total Charge (000s USD)])-[Direct Cost]

 

but it is not giving me result it is only showing blank.

anything I missed?

2 Replies
Highlighted
Partner
Partner

Re: Subtract not working in expression...

why is [Direct Cost] outside the if statement?

try changing to
=if([Cycle Name]='FORECAST',[Total Charge (000s USD)]-[Direct Cost] )

Highlighted
mwoolf
Honored Contributor II

Re: Subtract not working in expression...

In addition to dilipranjith's reply, if either field is null the subtract will be null.

You can replace the subtract with: rangesum([Total Charge (000s USD)]),-[Direct Cost])