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

how to display total of a row based on a condition in bar charts

Hi All,

I am a newbie to QlikView and have recently installed QlikView 9 Personal Edition and have started doing hands on. Pardon me if my query looks to be too basic, any help would be greatly appreciated.

I have a table with fields. I need to display the total of a field of few rows where all those rows satisfy a condition on another field, this total value needs to be displayed in a bar chart, i hope i am clear.

I am enclosing the example data below for clarity, hope it serves the purpose.

Request Status Time(sec)

Req1 In Process 100

Req2 In Process 200

Req3 Completed 50

Req4 Completed 70

In the above case, i have a listbox which displays Request and another list box having Status.

My Requirement is that if i chose "In Process" in status listbox a bar chart should display the sum of all the time ie. it should display value (100 + 200)300 sec and if i choose "Completed" in Status list box it should display (50+70) 120 sec in the bar chart.

I understand if i introduce a bar chart in my view then what should be the expression that i should put so that my requirement above is satisfied ?

Thanks in advance

Anurag

5 Replies
Not applicable
Author

Dear Anurag,

Please use the following expression:

sum

(total Time)





This will solve your query.

Kind Regards,

Vineet Agarwal

Not applicable
Author

Dear Vineet,

Just wanted to know where to include the condition i.e. i need to sum all those rows where Status equals that value which i have selected in Status listbox, i.e. if i select "In-Process" in status list box then expression should sum up all time values belonging to those rows which have status as "In Process" only, hope i am clear.

Thanks again

Not applicable
Author

Dear Anurag,

In the expression where you normally write sum(Time). Instead of this just write sum(total Time) and your will get the desired result.

Kind Regards,

Vineet Agarwal

Not applicable
Author

Dear Vineet,

Thanks a lot !! It worked..

Sorry for my earlier confusion in the previous post..

Regards

Anurag

Not applicable
Author

Dimension = Status

Expression=Sum ([Time(sec)])

Hope you got the required result!