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: 
dmohanty
Partner - Specialist
Partner - Specialist

Remove records/rows from a Chart using a Button?

Hi All,

I have a requirement like this below:

I am having a straight/pivot table, where the 1st column(1st dimension) is ID. My task is to select my necessary IDs from a List Box/Chart and using a Button to export the selected row of data to an Excel Sheet. I can achieve this through Macro.

But my challenge is that, after being exported, the row of data should be removed from the Chart as well. Is it possible anyhow?


Also, is it possible to create a SORT List Box with values ASC and DESC to sort the records (mainly the IDs/TimeStamps in Chart) in the Chart using the ASC and DESC radio buttons?


Hope I am clear on this. Please help with some examples.


7 Replies
Josh_Good
Employee
Employee

Here is a way to create listbox driven sorting.  In the script I loaded two inline tables and then I created an expression in the sort field that looks at what is selected on the inline tables.

On the exporting to excel issue.  Why not just have the users select what they want and then push the export to excel button in the object caption.

dmohanty
Partner - Specialist
Partner - Specialist
Author

Thank you Josh,

I will learn from the concept you have implemented for SORTING. Many Thanks.

But still regarding the Exporting and Removal of Rows concept, could you please help a bit more? I am fine with exporting to excel. But how to achieve removal of rows?

Exactly removal of rows if not possible, then somehow we can hide them conditionally?

Any more suggestions friends please?

Regards!

tresesco
MVP
MVP

If you select say year 2013, your straight table records get updated accordingly with the associated selection records. If you then send the chart to excel, the rows in the chart only gets exported to excel. Don't you want this that way? what do you mean by removal of rows? removal of which rows?

dmohanty
Partner - Specialist
Partner - Specialist
Author


Hi Tresesco,

Let me explain a bit more.

When I am selecting 2013 as year, suppose my chart shows 12 rows of data (Jan-Dec).Now I want to select the row containing Jan and Feb data and export to excel using a Button, That I can achive through Macro.

Now the task is, after the export of the Jan and Feb data, those two rows should be removed(may be hidden) from the QV chart as well. The chart now should show only the data which are not exported (Mar-Dec data).

Hope I am clear.

I am not sure how to remove the rows from QV charts.Can it be possible somehow?

tresesco
MVP
MVP

Could you please post your sample app with the macro?

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hi Tresesco,

PFA.

IN the QVW, I have 8 records in the chart.If I select 2013>>Jan,Feb, the chart shows 2 records. Now using the Button I am able to export the data to a QVD/Excel.

After that I need the values Jan and Feb and their associated sales should be removed from the dashboard as well.
(if cant be removed, may be some way can we hide?). So that when I Clear All the selections, now my chart would show  6 records (4 rows for 2012 and 2 rows for 2013).

Hope you are clear now. Requirement seems quite complex; not sure if it can be possible or not in QV.

tresesco
MVP
MVP

In your button actions, add one more action 'Set Variable' (vExclude->1). Then change the expression of your chart to like :

=If(vExclude=1, sum({<Month=E(Month)>}Sales), Sum(Sales))

I have done with a separate button. PFA