Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Columns as Expressions, Rows as Dimension

Hello

I have the following data set:

  

ProjectCost1Cost2Cost3
A156
B336
C143
D345
E464

I want a line chart where the X-axis are Cost1, Cost2, Cost3, and the line connecting each Project's Cost is shown.

Any help would be appreciated.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Ok, your data needs to be in the form

Project, Cost, Value

A, Cost1, 1

A, Cost2, 5

...etc

Then in your chart you add Cost as first dimension, Project as second dimension and sum(Value) as expression.

If your data is in the form you posted above then you first need to transform it in the script with the crosstable function

Data:

crosstable(Cost, Value,1)

load

Project, Cost1, Cost2, Cost3

from ...somewhere...;


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Since you're talking about a line chart it sounds like all you need to do is change the Orientation on the Style tab. If that's not the case I obviously don't understand what you want. Can you show what the result should look like? Also are cost1, cost2 and cost3 fields? If they are expressions can you post the expressions too.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your response.

This is what I want:

Chart.png

Of course the actual data that I am working with is more complex. There are a larger number of Projects and Costs.

Edit: The above image I added was achieved with Excel by simply switching the Row and Column.

Gysbert_Wassenaar

Ok, your data needs to be in the form

Project, Cost, Value

A, Cost1, 1

A, Cost2, 5

...etc

Then in your chart you add Cost as first dimension, Project as second dimension and sum(Value) as expression.

If your data is in the form you posted above then you first need to transform it in the script with the crosstable function

Data:

crosstable(Cost, Value,1)

load

Project, Cost1, Cost2, Cost3

from ...somewhere...;


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much. It worked perfectly.