Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Opening a Sheet based on the click of a selected chart in an other Sheet

Hi,

   

     I have a couple of Questions over here.

     The first one is I need to open a sheet based on the click of a bar in some other chart.Please let me know how to acheive this?

      The second one is: Suppose we have some data in a table 

        Column A    Column B       Column C

           A                  1                   @

           A                   2                   %

           A                    3                  (

           B                   4                    *

           C                   5                     &

      

        Now  A is present three times,but I have to show it only one single time. Something like

          A              1         @

                           2         %

                           3          (

        

        I have no Expressions here.

        Please let me know the way forward.

   Regards

   Navin Gorapalli     

15 Replies
Anonymous
Not applicable
Author

Hello

I am unsure of how to answer your first question was far as i am  aware you cannot add a trigger to a graqph you may be able to do this using a macro which checks if the object has been activated by clicking on it but it will only work once unless object is deactivated first.

The second unless i misunderstand the question could you not use a pivot chart, with the data supplied it would group column A so "A" would show once with user being able to drill down into columns B and C, you can set alway fully expand the pivot in properties as well.

Not applicable
Author

Hi,

  I cannot show a Pivot table here as I do not have any Expression to show.

  How can I activate a particular sheet object(may be a straight table) in another chart using a macro?

  This Macro will run when a bar is clicked on a bar chart which means another sheet should also activate and

   along with this a table based on which bar I have clicked should also get activated

  Regards

  Navin Gorapalli

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

  You can create a pivot with expression as 1 and you can hide this column, from presentation tab of chart properties.

  So you will get what you want.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Kaushiks response should work unfortunately with regards the Macro i would be unable to help i have not written VB in about 4 years lol am extremelly rusty but from experience that is the only way i think you could accomplish what you are trying to achieve.

Not applicable
Author

Hey Kaushik,

                    But a Pivot doesnt give us the option of hidng a column right?

                    I am working on Qlik View 10

Regards

Navin.G

erichshiino
Partner - Master
Partner - Master

Hi,

For the first question, I believe you should use a pivot table and use an expression for the last column (=only([Column C]) for example)

or you can include an expression like ' ' and make the column very small...

I found the second question very interesting. I may depend a little bit on what you want to do.

I tought that the user would use the chart to make a selection in a field. I would use that selection to choose another sheet to be activated.

I also tought that the user could make the same selection on other place in the interface but I would not want to send him to another sheet.

My approach was:

- When there is a selection in a specific field (Group, for example), test if the users is in the right sheet.

- If he is in the right sheet, test if it is the right object (the chart)

- If it is the right chart, test if there is one an only one selection in the field (Group)

- If there is only one selection, check the selected value to send the user to the right sheet.

That the macro I came up with. I included many message boxes, so you can see what I am testing

sub gotoSheet

if ActiveDocument.Sheets(0).IsActive then

    rem ** actions when macro triggered from first sheet **

    msgbox("You are in sheet 0")

else

msgbox("You are not sheet 0")

end if

set s0 = ActiveDocument.GetSheetObject("CH01")

if s0.isActive then

msgbox ("The right chart is active")

   set mySelections = ActiveDocument.fields("GROUP").GetSelectedValues

      IF mySelections.Count =1 THEN

          MSgBOX "There is only one value selected"

          msgbox "Moving to other sheet..."

          msgbox "The Selected Group is " & mySelections.Item(0).text

          if mySelections.Item(0).text="A" then

          ActiveDocument.Sheets("Group A").Activate

          end if

         if mySelections.Item(0).text="B" then

         ActiveDocument.Sheets("Group B").Activate

         end if

      else

          msgbox "There is more than one value selected"

      end if

else

msgbox ("The right chart is not active")

end if

end sub

I also included the app on my post

Hope it helps,

Erich

Not applicable
Author

Hi,

    Thanks Erich for your valuable time.But the problem here is I have four expressions in the same chart

    Now I have to somehow identify which bar (as there are four expressions and hence four bars) has been

    clicked.These four expressions correspond to four different fields.

    EX: Sum(a),Sum(b),Sum(c),Sum(d).Here,a,b,c,d are four fields

     In the detail sheet I have data in the tables like there are four tables.Each table corresponds to data of the four

     expressions I have mentioned above.

     Now based on the click the data sheet has to open and that particular table.The remaining tables will be  

     minimized.

 

     Please let me know the way forward

Regards

Navin Gorapalli

neetu_singh
Partner - Creator III
Partner - Creator III

Hi,

your 1st question answer is: you can achieve this by using macro and call that macro on button click. you can place that button on bar chart and hide that button. so when you click on bar on the basis of this it will move on another sheet and gives the data of that particular selection.

Please find the attached application.

Regards

Neetu SIngh

Not applicable
Author

Hey,

       Thanks Neetu this is what I needed but the only thing I am unble to get is how have you

       taken the button to occupy the entire width of the bar coz the bars can have different widths

       at time.

Regards

Navin Gorapalli