Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression dropping negative values

When I attempt to create a straight table the expression total is dropping any negative values from the table loaded.  How do I include the negative values in my straight table?  Example listed below.

Table before loaded into QlikView.

Field1     Field 2

A           $1000

B           $(500)

B           $1000

C           $(500)

C           $1000

Total      $2000

Table when creating a straigt table in Qlikview

Field1     Field 2

A           $1000

B           $1000

C           $1000

Total      $3000

Both total table should equal $2000.  but after I load the data and use the Deminsion "Field1 and Expression "sum(Field2)" the negative values are not included in the Expression.  How do I include the negative values in my straight table to get a total of $2000 instead of $3000?

Thanks

Brian

1 Solution

Accepted Solutions
MayilVahanan

Hi

I think (500) is not considered as negative value here..

LOad *,If(SubStringCount(Field2,'('),PurgeChar(Field2,'()')*-1,Field2) as Field3 Inline

[

Field1,Field2

A,1000

B,(500)

B,1000

C,(500)

C,1000

];

Then use Field1 as dimension, sum(Field3) as expression..

PFA

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

Hi

I think (500) is not considered as negative value here..

LOad *,If(SubStringCount(Field2,'('),PurgeChar(Field2,'()')*-1,Field2) as Field3 Inline

[

Field1,Field2

A,1000

B,(500)

B,1000

C,(500)

C,1000

];

Then use Field1 as dimension, sum(Field3) as expression..

PFA

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.