Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Table Chart

Hi Guys

I am trying to build a table chart and have several columns to sum sales by department.

what expression should I use to build it.

Like in the chart expressions I have Sum(Sales) which gives me the total sales for all departments

I tried to add in the definition

Sum(Sales) where department = A

Note that i have a list box w all the departments and I am required to build a table and show a column for each department.

thank you in advace.

1 Solution

Accepted Solutions
swuehl
Not applicable

Table Chart

So you have one dimension Date and two expressions, right?

try this as expression 1:

=sum(if(department= 'Dept1',Sales))

and for expression 2:

=sum(if(department= 'Dept2',Sales))

Does this give you correct data if you don't select anything in field department?

You could also use two dimensions, Date and department and use a pivot table chart, pivoting e.g. department to the top and using sum(Sales) as expression.

Instead of above if() inside the sum, you could also use set analysis, but first try with one of the suggested.

regards,

Stefan

4 Replies
swuehl
Not applicable

Table Chart

Hi

have you tried using a straight table chart with dimension department and expression =sum(Sales) ?

This should give you sum of Sales per department. Use similar expression for other measures per department.

Hope this helps,

Stefan

Not applicable

Table Chart

I am using a straight table but I have to have the following columns

column 1: Date

Column 2: Dept1

Column 3: Dept 2

and so on.

I was able to add the date and the departments.

and i added If statement to the expression

I am not able to display the data.

however I added a department list box  and if I select one department I get its data and if I select more than once I dont see anything!

Any ideas

swuehl
Not applicable

Table Chart

So you have one dimension Date and two expressions, right?

try this as expression 1:

=sum(if(department= 'Dept1',Sales))

and for expression 2:

=sum(if(department= 'Dept2',Sales))

Does this give you correct data if you don't select anything in field department?

You could also use two dimensions, Date and department and use a pivot table chart, pivoting e.g. department to the top and using sum(Sales) as expression.

Instead of above if() inside the sum, you could also use set analysis, but first try with one of the suggested.

regards,

Stefan

Not applicable

Table Chart

Thank you Stefan!

I have used the pivot table and it works perfect however i am really interested in knowing the other solution "If  insode the sales epression ".

I appreciate your time.