Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Line chart: multiple lines for a single expresion

Hello,

I have a line chart with 2 expressions:

exp1:=Only({$<kpi={'$(vFirstKpiSelected)'}}>}data)

exp2:=Only({$<kpi={'$(vSecondKpiSelected)'}}>}data)

My question is: can I have multiple lines in chart (based on multiple selection from a listbox) for a single expresion?

Something like:

exp1:=Only({$<kpi={'$(vFirstKpiSelected)'}, ITEM_CODE={'item1','item2','item3'}}>}data)

and

exp2:=Only({$<kpi={'$(vSecondKpiSelected)'}, ITEM_CODE={'item1','item2','item3'}}>}data)

I tried this but it doesn't work.

Can you please help me?

Thank you.

1 Solution

Accepted Solutions
Not applicable
Author

Hello, thx for your help.

I managed to find a solution:

http://community.qlik.com/message/336572#336572

'For lines you can use two dimensions and one expression or one dimension and lots of expressions. If you need more than you'll have to use two charts and overlay them and give the top chart a transparent plot are'

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You can have multiple lines, set up with multiple expressions that are similar in this way.

Could it be that you are using only() instead of sum(). Only() will only return datapoints if there is just the one value.

Jonathan

Not applicable
Author

I tried sum

=Sum({$<kpi={'$(vPanel_KPI1_KPI1)'}>}data)

but still doesn't work, I have still one line per expression.

Please check attached image:

- the solid line is for  kpi1  has expresion1 :  ->  exp1:=Only({$<kpi={'$(vFirstKpiSelected)'}}>}data)

- the dashed line is for kpi2 has expresion2 : -> exp2:=Only({$<kpi={'$(vSecondKpiSelected)'}}>}data)

- blue solid and dashed line are for  product1

- red solid and dashed line are for  product1

What I want to achieve is to have blue solid+red solid for exp 1

                                                  blue dashed + red dashed for exp2.

Have any ideas?

Anonymous
Not applicable
Author

So do you have the lines coming out ok ? Is it just the formatting you are working on now ?

Jonathan

Not applicable
Author

Hello, thx for your help.

I managed to find a solution:

http://community.qlik.com/message/336572#336572

'For lines you can use two dimensions and one expression or one dimension and lots of expressions. If you need more than you'll have to use two charts and overlay them and give the top chart a transparent plot are'