12 Replies Latest reply: Sep 11, 2013 4:11 PM by Zohaib Ahmed

# Creating a line graph using Sum expression with a condition

Hi,

I have the following scenario. I have a table that looks like this:

Group               Value

A                      5

B                      10

C                      15

D                      20

A                     6

B                     11

C                     16

D                     21

Now, I want to create a line graph with 3 series (A, B, D), note that I want to ignore C. However when I use the sum expressions such as:

sum(  {\$<Group={'A', 'B', 'D'}>}  Value)

It also uses C for the sum. As in on the line graph, the value of D would be 50 instead of 35 for the first set. How would I ignore the value of C in the sum?

• ###### Re: Creating a line graph using Sum expression with a condition

Did you try?

sum(  {\$<Group-={'C'}>}  Value),

there´s a "-" before "="

• ###### Re: Creating a line graph using Sum expression with a condition

Yes, it produces the same result. As in the value of D still includes the summation from A, B and C.

• ###### Re: Re: Creating a line graph using Sum expression with a condition

Weird,

I´m posting a image and QVW with my test

• ###### Re: Creating a line graph using Sum expression with a condition

I think theres a bit of confusion. The x-axis for me would be the date. Heres the final result that I want:

• ###### Re: Creating a line graph using Sum expression with a condition

Could you post a print of your data model?

• ###### Re: Creating a line graph using Sum expression with a condition

Yes my table also has date. Its normalized such that there are 2 tables, one table has the date and an ID that relates it to an ID in the other table which has the name and value.

• ###### Re: Creating a line graph using Sum expression with a condition

Could you post a sample of your application

• ###### Re: Re: Creating a line graph using Sum expression with a condition

Here's an attached data set. What I'm expecting is the values for B should be 15 and 17, so that it would be value of A (5) + value of B (10) = 15, similarly for the other point and similarly for D.

• ###### Re: Creating a line graph using Sum expression with a condition

Shouldn´t B 10 and 11?

I´m a bit confused

You want

B values = A + B

D values = A + B + D?

• ###### Re: Re: Creating a line graph using Sum expression with a condition

Yes, thats what I want.

• ###### Re: Re: Re: Creating a line graph using Sum expression with a condition

Check if this solve your requirement

• ###### Re: Creating a line graph using Sum expression with a condition

Thanks! Can't believe I missed that.