Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Negative values in field

Hi all,

i got both negative and positive values in field how to distinguish them like positive,negative, Sum(positive and negative)  .

give me some examples please.

thanks,

1 Solution

Accepted Solutions
amit_saini
Honored Contributor III

Re: Negative values in field

Suppose this is your script:

load * inline [

A, B

a,-1

b,-2

c,-1

d,-3

e,-4

];

Now create a bar charts with A as dimmenison and =fabs(sum(B))  as expression for negative values.

So in this way you can show both -ve and +ve values in two different bars.

You can create one more filed as "C" in script with positive numbers and check as Sum(c)

Thanks,
AS

7 Replies
amit_saini
Honored Contributor III

Re: Negative values in field

Janaki,

Check this

Thanks,
AS

Not applicable

Re: Negative values in field

can you provide script please ,i haven't got lic here at the moment.

amit_saini
Honored Contributor III

Re: Negative values in field

Suppose this is your script:

load * inline [

A, B

a,-1

b,-2

c,-1

d,-3

e,-4

];

Now create a bar charts with A as dimmenison and =fabs(sum(B))  as expression for negative values.

So in this way you can show both -ve and +ve values in two different bars.

You can create one more filed as "C" in script with positive numbers and check as Sum(c)

Thanks,
AS

jyothish8807
Honored Contributor II

Re: Negative values in field

Hi Janaki,

Simply add an expression sum(Your field). You can use a bar chart.

PFA

Regards

KC

Best Regards,
KC
Not applicable

Re: Negative values in field

THANK YOU AMITH

amit_saini
Honored Contributor III

Re: Negative values in field

Cheers !

and its Amit    without ->"H"

Thanks,
AS

venkatasreekant
Valued Contributor

Re: Negative values in field

Hi Use the

fabs() function in the expression

like

=Fabs(Sum(Sales))

Community Browser