Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
alejandrogarcia
New Contributor

Chart colour depending on dynamic Average value

Hello,

I am relatively new to QlikView and I have come across an issue that I do not know how to solve.

I have a chart which shows the total number of occurrences. Using a cyclic group, I show the occurrences based on different dimensions for example ( as shown on attached image) total number of occurrences per month and total number of occurrences per week day.

I have added the average trendline on the chart and, as expected, it changes for each dimension.

How can I colour the bars with different colours depending if they are above (red) or below (green) the average?

I have done that in a chart with only one dimension by creating a variable vAvg and on the expression background putting a conditional that changes the colour if the value is higher or lower than that vAgv.

However, how can I do that on this scenario where the Average changes every time?

Thank you for your help.

QlikView Question.jpg

Tags (2)
1 Solution

Accepted Solutions
Partner
Partner

Re: Chart colour depending on dynamic Average value

Hi,

Use the function GetCurrentField(GroupName) to know which dimension in the cyclic group is presented in the graph. Unber the expression, you can press the + sign and in the Background color you can add an if statement together with the GetCurrentField(GroupName)  to give the bar a different color if it is below or above the average, where as the vAvg variable will change according to presented Dimension.

Liat

View solution in original post

2 Replies
Partner
Partner

Re: Chart colour depending on dynamic Average value

Hi,

Use the function GetCurrentField(GroupName) to know which dimension in the cyclic group is presented in the graph. Unber the expression, you can press the + sign and in the Background color you can add an if statement together with the GetCurrentField(GroupName)  to give the bar a different color if it is below or above the average, where as the vAvg variable will change according to presented Dimension.

Liat

View solution in original post

alejandrogarcia
New Contributor

Re: Chart colour depending on dynamic Average value

Thank you Liat Todt.

It has worked perfectly.

Thank you for your help.