Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Total line in combo chart to calculate first, not second, dimension

I have a combo chart with two dimensions:

     MonthName(Article_Viewed_At)

     Calculated dimension: if(Incident_Opened_Within2hrs=0,'Call Avoided','Call Generated')

In my expressions I have:

     Count(DISTINCT Article_Viewed_By) - Bar

I want to add a line showing the total volume for the first dimension but everything I have tried shows the line calculating for the second dimension causing the line to climb, then plummet, climb, then plummet because the calculated dimension is much smaller for call avoided.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The SA solution will not behave the same as the If. With the SA, you are making a selection and overriding the selection made in the listbox.

I think you can get what you want with SA by adding a "*" (intersection) set operator.

Count({$ * <View_Incidents_Within_2h={0}>}DISTINCT View_Viewed_By)

-Rob

http://masterssummit.com

View solution in original post

9 Replies
Nicole-Smith

Instead of using two dimensions, why not use two expressions (and then you can add a third expression for the line):

Dimension: MonthName(Article_Viewed_At)

Expression 1 (Call Avoided): Count({<Incident_Opened_Within2hrs={0}>}DISTINCT Article_Viewed_By)

Expression 2 (Call Generated): Count({<Incident_Opened_Within2hrs-={0}>}DISTINCT Article_Viewed_By)

Expression 3: (something for your line)

Anonymous
Not applicable
Author

When I apply a filter to show Incident_Opened_Within2hrs=0, the graph with 2 expressions works correctly but when I apply a filter to show >0, the chart does not change.

Nicole-Smith

I don't know what you mean.  Can you post a sample file?

Maybe try changing the second expression to:

Count({<Incident_Opened_Within2hrs={'>0'}>}DISTINCT Article_Viewed_By)

Anonymous
Not applicable
Author

The 2 expressions work great when no selection is applied but when I apply a selection to Incident_Opened_Within2hrs where greater than 0 (Call Genereated), my chart does not change.  The two expressions counts remain when Calls Avoided should become zero and disappear.  If I change the expression to Count(DISTINCT if(Incident_Opened_Within2hrs>0,Article_Viewed_By)) it works correctly.  I could try and create a sample later w/ data.

Nicole-Smith

If you leave the expressions the way that they are, you may be able to add a conditional expression to them in order to show/hide them based on the selection that you're talking about:

I'm thinking on the Call Avoided: Count({<Incident_Opened_Within2hrs={0}>}DISTINCT Article_Viewed_By)>0

and on the Call Generated: Count({<Incident_Opened_Within2hrs-={0}>}DISTINCT Article_Viewed_By)>0

Anonymous
Not applicable
Author

Attached sample.  One chart with set analysis, the other with an IF statement.  Apply a selection for call avoided vs generated and watch the graphs.  Thanks for the help!  The conditional I will try to avoid just because I feel the set analysis should work the same as the IF statement.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The SA solution will not behave the same as the If. With the SA, you are making a selection and overriding the selection made in the listbox.

I think you can get what you want with SA by adding a "*" (intersection) set operator.

Count({$ * <View_Incidents_Within_2h={0}>}DISTINCT View_Viewed_By)

-Rob

http://masterssummit.com

Nicole-Smith

Rob Wunderlich's solution works (see the attached).  I just learned something new

Anonymous
Not applicable
Author

Thanks for all the responses!  I now have this working how I want.  Thanks!