6 Replies Latest reply: Jul 16, 2018 11:02 AM by Seb Silva RSS

    Create Line Chart that Compares Selections Instead of Grouping Them

    Seb Silva

      New to Qlik Sense, thanks for your patience.

       

      I've created a line chart (see attached jpeg. I couldn't insert photo here, I got an error saying file type was forbidden for jpeg, png etc)


      Fields: Result, Machine

       

      The blue line is based on a measure I created with set analysis to show the percent of {Bad} results in the [Result] field.

      • Expression: count({$<[Result]={Bad}>} [Result]) / ((count({$<[Result]={[Good]}>} [Result]) + count({$<[Result]={[Bad]}>} [Result]))
      • Possible results in field [Result] are {Good, Bad}
      • This line changes based on selections in filter panes etc, as it should

       

      The red line is based on a measure I created with set analysis to show the percent of [Bad] results in the [Result] field made by machine {12} only.

      • Expression: count({$<[Result]={Bad}, [Machine]={12}>} [Result]) / ((count({$<[Result]={[Good]}>} [Result]) + count({$<[Result]={[Bad]}, [Machine]={12}>} [Result])))
      • Possible results in field [Machine] are hundreds! And that's where my problem and question begins...
      • This line doesn't change but only appears when machine 12 forms part of larger selection, as it should

       

      In theory, I could create a measure for every single machine (painful and not practical!), but I'm sure there has to be a better approach. Thoughts?

       

      Ideally, I'd like a line chart that shows multiple lines, one for each machine that corresponds to their individual percentages so I can compare them to each other.

       

      Ideally, I could select which machines to display individual lines for by selecting them from a filterpane/listbox. But, given qlik's associative selection process, selecting multiple machines just groups them together instead of selecting them for individual lines.

       

      Thanks in advance for your help.