Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Check if dates fall in alternate state

I'm using a bar chart to show the volume of incidents created in alternate state A and B.  I want to change the bar color if the date falls into A.  Possible?

7 Replies
PrashantSangle

Hi,

It is possible

You can click on + sign of your expression you will see Background Color.

In that right expression like

if(fieldname='A',Red(),Green())

Or

if(fieldname='A',RGB(125,125,125),RGB(255,255,255))

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 🙂
SunilChauhan
Champion
Champion

write in background of expression

if(state ='A' and isnull(Date)=-1,REd(),Green())

hope this helps

Sunil Chauhan
Anonymous
Not applicable
Author

Neither worked.

I think Max's is checking to see if the field is equal to string value of.

Sunil - is state supposed to be a function or the state name?

jerem1234
Specialist II
Specialist II

Could you elaborate a little more of your situation and explain the expressions/dimensions of your chart and maybe how you are using the alternate states. Not sure what you mean by "date falls into A".

Gysbert_Wassenaar

Maybe something like:

if( MyDate >= min({A}MyDate) and MyDate <= max({A}MyDate , blue(), red())


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Sure can.

I have a bar chart in the inherited state w/ the following:

Dimension: WeekStart(Opened_At)

Expression: Count(Distinct {StateA} Incidents) + Count(Distinct {StateB} Incidents)


I have 2 separate list boxes with all the WeekStart(Opened_At) values, one in StateA and one in StateB.  When a week is selected in each list box, the bar chart shows volumes for the days in those weeks.  I want to change the bar colors based on the the week they fall in so the data appears separated and users know the bar falls into StateA vs StateB.


Before finishing this, I did just realize I can do a background color expression for checking the count.  Using:

=if(Count(Distinct {StateA} Incidents)>0,red(),green())

SunilChauhan
Champion
Champion

its state Name field which should b e available in ur app.

Sunil Chauhan