Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart Average line value -> use it in other chart

UPDATE: I added sample:

load script loads excel file with date / value 1

this is shown in first chart: together with internal average line.

and i need to know this average value to use it in a second chart:

e.g. this second chart uses other values but those values need to be coloured if they are higher or lower than the average value of the first diagram ?

My question is: can we get this value within module scripts ?

hi,

how can I use a chart average (trend line) value in another diagramme ?

is there any possibility to read this average value (trend line) within a macro ? like Chart.properties and then the average value ?

I could not find any solution.

Thanks for your help.

11 Replies
sunny_talwar

Would you be able to share an example of what you are trying to do? May be it is doable without a macro? Not really sure until we see more details

boorgura
Specialist
Specialist

Am not sure if I totally understand the requirements.

Can you capture the average in an expression/variable? and use that as a "reference line" under Presentation tab of the chart properties?

Not applicable
Author

added example data

sunny_talwar

Is this what you are looking for?

Capture.PNG

Where the avg line is created using this expression:

Avg(TOTAL Aggr(Sum([Messwert 1]), Datum))

and background color using this:

If(Column(1) > Column(2), LightGreen(), LightRed())

Where Column(1) is your expression for the bar [Messwert 2] and Column(2) is the Avg expression from above (Avg(TOTAL Aggr(Sum([Messwert 1]), Datum)))

Not applicable
Author

thanks for your help.

however I have still one question about conditional coloring of the chart rows:

I know tha in diemnsion or expression I can use background coloring in an if expression.

BUT: I have 5 rows in a chart.

each row-value has to be compared to the value of a related variable.

so: field1 (of row1) compared to variable1, field2 (of row2) compared to variable2 ....

how is this possible:

with the expression RowNo and building nested if clauses ?

or which are the options,

thanks again

sunny_talwar

5 rows in a chart? I am not entirely sure I understand your question. Can you elaborate a little?

Not applicable
Author

‌sorry 5 rows in a table box, not chart.

sunny_talwar

Can you provided an updated sample with the expected output?

Not applicable
Author

i added a sample for this problem