Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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?

Thanks in advance

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Check if this solve your requirement

View solution in original post

12 Replies
Clever_Anjos
Employee
Employee

Did you try?

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

there´s a "-" before "="

Not applicable
Author

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

Clever_Anjos
Employee
Employee

Weird,

I´m posting a image and QVW with my test

ahmed.png

Not applicable
Author

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

graph2.png

Clever_Anjos
Employee
Employee

So your table as date?

Could you post a print of your data model?

Not applicable
Author

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.

Clever_Anjos
Employee
Employee

Could you post a sample of your application

Not applicable
Author

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.

Clever_Anjos
Employee
Employee

Shouldn´t B 10 and 11?

I´m a bit confused

You want

B values = A + B

D values = A + B + D?