Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

I would like to create a macro (to be executed with a button) which sets the property "Max Visible Number" in the upper right corner of the Presentation Tab in the options of a bar diagram, on e.g. 10 or x+5 or something like that. Unfortunately I can't find specific information in the API Guide. Has perhaps someone experience with that? Thanks a lot in advance, Martin

1 Solution

Accepted Solutions

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

    I got the solution.

    Try this.

   

set chart = ActiveDocument.Sheets("Main").CreateBarChart

chart.AddDimension "F1"

chart.AddExpression "count(F1)"

set cp = chart.GetProperties

set dims = cp.Dimensions

dims(0).MaxNumShown.v = 10

chart.SetProperties cp

Regards,

Kaushik Solanki

15 Replies

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

    Here is the code from API guide to set the maximum visible number.

  

set chart = ActiveDocument.Activesheet.CreatePivotTable

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

chart.AddExpression "count(Customer)"

set cp = chart.GetProperties

set dims = cp.Dimensions

dims(0).MaxNumShown = 10

chart.SetProperties cp

This will set the value to 10 for the dimension "ProductType"

and that is specified by this line

dims(0).MaxNumShown = 10

Hope this will help you

Regards,

Kaushik Solanki

Not applicable

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi, thanks a lot for your help. I tried it but when I click the button it shows me this:

110817_0912.png

The text means something like "Wrong number of arguments or invalid property assignment".

Where is my mistake?

Thanks,

Martin

PS: Is there some kind of overview somewhere which shows me information like this one? (e.g. the fact that this property is called MaxNumShown)

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

    Can you please translate the error you got at the top in english.

Regards,

Kaushik Solanki

Not applicable

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

I did, below the image. :-)

This is what google-translation says:

"Wrong number of arguments or invalid property assignment: 'dims (...). MaxNumShown'"

Regards,

Martin

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

    Can you tell me what are the dimension you have specified in your charts.

Regards,

Kaushik Solanki

Not applicable

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

I have just a simple example with one dimension "Firma" (Account):

110817_0943.png

110817_0944.png

Regards,

Martin

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

    I checked, but the code given in API is not working.

    Sorry, i am working on this. Will let you know if i get any solution on this.

Regards,

Kaushik Solanki

Employee
Employee

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

I think the problem is you are giving a number for a string parameter, try with

dims(0).MaxNumShown = "10"

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

    I got the solution.

    Try this.

   

set chart = ActiveDocument.Sheets("Main").CreateBarChart

chart.AddDimension "F1"

chart.AddExpression "count(F1)"

set cp = chart.GetProperties

set dims = cp.Dimensions

dims(0).MaxNumShown.v = 10

chart.SetProperties cp

Regards,

Kaushik Solanki

Community Browser