Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

creating bar graph via macro

Hello everybody,

I'd like build a bar graph programatically via macro script.

I found sometihig like this in API tutorial

set Graph = ActiveDocument.Sheets("Assistenza").CreatePieChart

Graph.AddDimension "C_ARTICOLO_8"

Graph.AddExpression "sum([Quantità transazione])"

Graph.AddExpression "sum(%)"

end sub

My problem is thsat the Expression in not a function of any DIMENSION but values coming from another linear table.

Is there any function or method allow me to build a dimension with values from another table(graph).?



Something creating dimension on the fly?

Thank you for reading y post.

Denis Matteazzi

7 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi Denis,

Sound like you need AGGR.

AGGR will create a "virtual" chart in memory and you can then apply other functions (e.g. SUM, MAX, AVG, etc.) to the results.

AGGR can also be used to calculate dimensions.

Have a look in the help file. If you can't find what you are looking for, post a more detailed example of your query and we may be able to show you how to achieve what you are doing.

Regards,

Stephen

Not applicable
Author

Hi thank for the quick answer but i don't know if AGGR could help me.

I have a linear table like this:

col1 col2 col3 col4 col5 res = function(col1,col2,col3,col4,col5)

Item1 10 3 5 7 8 2,5

Item2 3 4 3 1 3 1,8

I'd like use Art1,Art2 as values for bar graph (it's ok because Item1 and Item2 is already a DIMENSION) and the value of res for the expression.

Is there any way of make programatically a DIMENSION starting from values of res?

I hope it's clear,,but I doubt 🙂

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I recommend that you build an example and post it here, it will be easier for people to offer solutions.

Not applicable
Author

I added as an attachment the qlick file so you can help me with an example.

Thank you very much.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

no attachment - please double check

Not applicable
Author

it seems like I am not allowed to upload the attachment. Everything seems to be ok but I can't see my att.

Not applicable
Author

here