Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
cluscombe
Contributor III
Contributor III

Variables, pivot chart heat maps, if statements, and input boxes

Hi Everyone,

I am trying to make a pivot table with "heat map" of the values using the "background color expression".

I was able to successfully does this using the following if statement in the "background color expression":

If([Load Factor %] >= .85, Green(), If([Load Factor %] >= .70, LightBlue(), LightRed()))

Resulting in a chart like this:

However, you will note above that Green and Blue values are hard-coded at .85 and .70 respectively.  I want to make an input box where the user can decided was values will make some green or blue.  To attempt this I did the following:

  • downloaded an input box from Branch
  • Created two variables
    • vGreat, and set initial value to .85
    • vGood, and set initial value to .70
  • Changed if statement to: If([Load Factor %] >= $(vGreat), Green(), If([Load Factor %] >= $(vGood), LightBlue(), LightRed()))
  • Created two input box using branch extension
    • set first input box to use variable "vGreat"
    • set second input box to use variable "vGood"

But my heat map pivot table just doesnt seem to react correctly.  It appears that the first input box works as expected, but then it appears whatever value I put in the second input box is just ignored.  Any ideas?

I have attached the QVF I am working on, please refer to the "analysis tab".  There you will see the heat map with hardcoded values, heat map attempt with variables, and the two input boxes.

Thanks!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I'm sorry, but it works fine for me. Either with changing the values directly in the Variable Editor UI or with another variable extension qsVariable that I already had installed. But maybe I just don't understand why you would make the value of vGreat smaller than the value of vGood.


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Gysbert_Wassenaar

Can you post a smaller example? I'm not going to download 52 MB.


talk is cheap, supply exceeds demand
cluscombe
Contributor III
Contributor III
Author

Done.  Same data, just limited load to 10,000 records.

Gysbert_Wassenaar

I'm sorry, but it works fine for me. Either with changing the values directly in the Variable Editor UI or with another variable extension qsVariable that I already had installed. But maybe I just don't understand why you would make the value of vGreat smaller than the value of vGood.


talk is cheap, supply exceeds demand
cluscombe
Contributor III
Contributor III
Author

can you show me a screenshot where you input .90 (vGreat) in the first input box and .50 (vGood) in the second input box?

Gysbert_Wassenaar

See attached image. I've added the same limits to the top pivot chart so they show the same colors.


talk is cheap, supply exceeds demand
cluscombe
Contributor III
Contributor III
Author

‌So strange, I must be doing something incorrectly. Could to attach your qvf?

Gysbert_Wassenaar

Sure. Here  you go.


talk is cheap, supply exceeds demand
cluscombe
Contributor III
Contributor III
Author

‌thanks! Much appreciated.