Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Set Analysis little issue

Hi Guys,

I am trying to use the following formula within a bar chart to get an average

=Sum({1<[Type]={'A'}>}[Amount])/Sum({1}B)

The Dimension is C.

I need to get a straight line of average across the bar chart. Not sure what I am doing wrong here.. I've done this hundred times before with no issue.

The formula above returns a zigzag line that moves with the bars..

Let me know your thoughts and thanks in advance.

Best,

Alec

1 Solution

Accepted Solutions
alec1982
Specialist II
Specialist II
Author

For some reason it doesn't work on my QVW even I am 100% sure that all the above is correct. I have used the reference line from the presentation tab as a solution as i don't think it is worthy to spend more time on this.

Thank you all for your help.

View solution in original post

24 Replies
MK_QSL
MVP
MVP

SUM({<Type = {'A'}>}Amount)/SUM(B)

alexandros17
Partner - Champion III
Partner - Champion III

The expression you have written generates a different value for each value of dimension (1 means that is valid not depending by selections ...)

So ... what kind of average do you need really?

alec1982
Specialist II
Specialist II
Author

I need to have one value across  all dimensions. for example if you put the above formula in a text box it returns $1000. I need a line of $1000 to show across all the dimensions.

PrashantSangle

Hi,

you can implement your expression as Reference line.

You can achieve this chart->properties->Presentation->Reference Line -Expression.

this will help you.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable

In "Presentation" tab of the chart properties, add this expression in "Reference Lines" instead of adding it in "Expressions" tab. that will generate a straight reference line with the value you need. Is that what you are looking for?

Not applicable

create a variable with that expression with '=' sign and use it instead. if ref line is not ur alternative.

MK_QSL
MVP
MVP

Can you provide sample data?

alec1982
Specialist II
Specialist II
Author

Hi Can you please give me an example.. I am getting an error.

The reference line works but I need to add it in an expression so I can see it in the legend.

Thxs,

Alec

alec1982
Specialist II
Specialist II
Author

Simply any table with B, Type and C columns where C is a state  and Type has multiple types and B is the amount.

My PC wont let me attached QVWs..

Thxs,

Alec