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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
agigliotti
Partner - Champion
Partner - Champion

Qlikview bar chart background color issue

Hello,

I'm stuck with the below expression used in background color expression:

---

If(

  Column(1) = Max( TOTAL Aggr(

  Sum( {< %CodiceCollaboratore -= {"000"}, %Data = {">=$(=AddMonths($(vStartA), -12))<=$(=vHeaderDataFineIms)"} >} QtaIms ), MeseAnno ) ),

  LightGreen(),

  if( Column(1) = Min( TOTAL Aggr(

  Sum( {< %CodiceCollaboratore -= {"000"}, %Data = {">=$(=AddMonths($(vStartA), -12))<=$(=vHeaderDataFineIms)"} >} QtaIms ), MeseAnno ) ),

  LightRed(),

  If( Floor(Max(%Data)) = Floor(MonthEnd(vHeaderDataFineIms)), $(vColor_State_B),

  RGB(214,231,248) ) ) )

---

The Bar Chart unique dimension is "MeseAnno."

The unique expression used in bar chart is:

Sum( {< %CodiceCollaboratore -= {"000"}, %Data = {">=$(=AddMonths($(vStartA), -12))<=$(=vHeaderDataFineIms)"} >} QtaIms )

I need to color Max and Min expression values in different colors.


How can I achieve it ?

Many thanks in advance.

Best Regards

Andrea

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Assuming your variables are correct, the expression looks OK to me. What is it doing incorrectly?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
agigliotti
Partner - Champion
Partner - Champion
Author

Take a look at image attached.

It seems to apply only color related to vColor_State_B variable.

The second image is the straight table comes from fast type change.

jonathandienst
Partner - Champion III
Partner - Champion III

As i said, the expression looks OK, so i suggest that you upload a sample qvw to illustrate the problem for more detailed inspection. As a start please show how you define the variables in the expression.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
agigliotti
Partner - Champion
Partner - Champion
Author

It's a little bit strange the expression works as expected only in straight table.

In this case the Max value is the same as the evaluation of the below expression:

Floor(Max(%Data)) = Floor(MonthEnd(vHeaderDataFineIms))

That's why I think its color might be vColor_State_B rather than LightGreen().

agigliotti
Partner - Champion
Partner - Champion
Author

I replaced the variables with its values like below:

%Data = {">=01/04/2015<=30/04/2016"}

but I still have the same behavior.

sunny_talwar

Would you be able to share a small sample where you can show the issue to us? It would be difficult to replicate it at our end

Preparing examples for Upload - Reduction and Data Scrambling