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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
john_duffy
Partner - Creator III
Partner - Creator III

Select rows in a chart with dynamic dimensions


Hello All.

I have a chart with dynamic dimensions.  The dimensions are enabled based on selectons in another field.

What the users would like is to have a 'Select' column as the first column to allow them to select a row without having to select all fields in the row.

I have attached a sample application. Columns Type1 through Type5 are endable/disabled based on the selection in the list box Sales Types.  With Sales Types 1 - 4 selected, 3 rows appear in the chart.

The user could drill down to one row by selecting a value in Type1 and dragging across the other 3 columns.  They don't want to have to do this.

In the sample application, I have created an expression called 'Select' using the rowno(total) function to assign a unique number to each row.  This allows the user to select a row with one click on the Select column.  The problem with this is that a Clear Select button is required if they want to select a different row.  Ultimately, they would like to click a second time on the Select column to have all rows reappear.

Keep in mind that the attached application is a very simple application.  The actual application is much more complicated, with millions of rows of data.  I'm really trying to avoid using a calculated dimension with any kind of aggregation due to performance.

Any ideas of a better way to do this?  Any suggestions would be appreciated.

We are using QV11 SR2.

Thanks,

John.

1 Solution

Accepted Solutions
Anonymous
Not applicable

I see.  Need some aggregation, and the aggregation should be dynamic.

see attempt #2.  The difference is in the expression.  And there is a variable now.

View solution in original post

8 Replies
Anonymous
Not applicable

John,

Can be done by adding a dimension based on a new field which is based on all Type N fields.  See attached.

Regards,

Michael

john_duffy
Partner - Creator III
Partner - Creator III
Author

Hi Michael.

Thanks for the quick response.

The only issue with this is that it will not sum the rows.  For example, if the user selects Sales Type 2, there should be two rows displayed Type2 = B, sum of sales 40 and Type2 = G, sum of sales 20.

In your application Type2 = B will be displayed twice, once for sales of 10 and a second time for sales of 30.

Thanks,

John.

Anonymous
Not applicable

I see.  Need some aggregation, and the aggregation should be dynamic.

see attempt #2.  The difference is in the expression.  And there is a variable now.

john_duffy
Partner - Creator III
Partner - Creator III
Author

Thanks Michael.  That works great.

My only concern would be performance.  The actual production application has millions of rows of data and the charts have numerous, complicated expressions.  Won't know for sure until I try your technique.

Your thoughts on performance?

Anonymous
Not applicable

John,

Agree, there is a performance risk, especially if you have already "numerous, complicated expressions".  Adding calculated variable and aggregation in expression is not going to help, but I can't tell how much difference it'll make.

Appreciate any follow-up with the test results,

Regards,

Michael

john_duffy
Partner - Creator III
Partner - Creator III
Author

Thanks again Michael.

I'll let you know.  I'm going to leave this post unanswered for another day or so to see if anyone else adds some input.  After that, I will mark your solution as the correct answer.

One last question, what did you think of my original technique of using an expression with rowno(total) as the select column?  Always interested to hear pros and cons of my code.

Anonymous
Not applicable

There is nothing wrong with your original technique, except it selects values in all chart dimensions - and this is exactly what you want to avoid.  Maybe it's not a problem after all?

My first thought was to create a calculated dimension (instead of the new field), but it would be aggregated by the same "Type N" dimensions, hence the problem (selection in all dimensions) would not be resolved.

john_duffy
Partner - Creator III
Partner - Creator III
Author

Hi Michael.

Just to finish off this post.

I decided to go with the method to create a Select expression which will all the user to select all dimensions with one click.  I created the expression using the rowno(total) function but then realized this would prevent the user from sorting on any expressions.  I ended up simply creating an expression with a value of 'Select' which would select all dimensions in the row.  The word 'Select' appears on every row in the first column of the chart.  This is what the user wants.

Personally, I would prefer not to create this select column and give the users the ability to select individual dimensions or simply select and drap across all dimensions, but this is not what they wanted.

Thanks again for your input and alternate solution to this problem.

John.