Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ihuynhi
Contributor II
Contributor II

Line chart number of lines based on number of elements chosen on filter

I'm new to QlikSense so apologies if I get any terms wrong. I have a line chart where I have a date on the x-axis and sum of the sales amount in the y-axis. I added a filter which has different areas and when I choose an area from there, the chart shows the sales for that area. However, when I choose two or more areas, the line chart will show the sum the sales of all the areas chosen whereas I'd like to have all the lines separately for all the areas. How can this be done in Qlik? I know how to use alternate state, however, I would then have to add multiple filter panes for each area (and link them to different alternate state) and not necessarily all of them will be used.

Labels (3)
1 Solution

Accepted Solutions
eddie_wagt
Partner - Creator III
Partner - Creator III

I am not quite sure what you exactly want. Are you looking for this?

eddie_wagt_1-1654251023871.png

 

This can be done as follows:

1. Chose line chart

2. Add date as dimension

3. Add area as dimension

4. Make a variable: vSelectedArea with definition =if(GetSelectedCount(area)>0,GetFieldSelections(area),concat(distinct {1}area,','))

5. Add expression to chart 

Sum({$<area={$(vSelectedArea)}>}amount)

Mmmm... now I was thinking that you might want a single line when no area has been selected?

Anyway, maybe this helps a little, otherwise let me and the community know what you exactly are looking for.

 

Kind regards

Eddie

If this answers your question or solves your issue, be sure to mark the answer as correct by clicking 'Accept as Solution'. This will mark the post as solved and other Qlikkies will gravitate towards this post as it as a possible solution for their issue. Multiple responses can be accepted as a solution so make sure to select all that apply.

View solution in original post

1 Reply
eddie_wagt
Partner - Creator III
Partner - Creator III

I am not quite sure what you exactly want. Are you looking for this?

eddie_wagt_1-1654251023871.png

 

This can be done as follows:

1. Chose line chart

2. Add date as dimension

3. Add area as dimension

4. Make a variable: vSelectedArea with definition =if(GetSelectedCount(area)>0,GetFieldSelections(area),concat(distinct {1}area,','))

5. Add expression to chart 

Sum({$<area={$(vSelectedArea)}>}amount)

Mmmm... now I was thinking that you might want a single line when no area has been selected?

Anyway, maybe this helps a little, otherwise let me and the community know what you exactly are looking for.

 

Kind regards

Eddie

If this answers your question or solves your issue, be sure to mark the answer as correct by clicking 'Accept as Solution'. This will mark the post as solved and other Qlikkies will gravitate towards this post as it as a possible solution for their issue. Multiple responses can be accepted as a solution so make sure to select all that apply.