Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can you help with this expression, I was trying to color each bar (3 in total) by inspection status, Initial to be blue, passed to be green, failed to be red:
if([InspectionStatus]='Failed',rgb(242,0,0)),if([InspectionStatus]='Passed',rgb(0,242,0)),if([InspectionStatus]='Initial',rgb(0,0,242))
The above expression gives the error : garbage after expression ','
The below expression colored all the stacked bars blue, but I need to get the three colors:
=if(InspectionStatus,'Initial',rgb(0,0,242))
Thanks in advance,
Newbie Qlik User Mike
With help from our BI team, we solved it by changing the measure expression to one instead of three, adding a bar inspection status dimension and the below color expression:
Count({$<Bucket ={'Requested Inspections'}>*$<InspectionType = {"*Hazard Elimination Assessment*"}>} distinct IMInspectionID)
if(InspectionStatus='Initial', blue(),
if(InspectionStatus='Passed', green(),
if(InspectionStatus='Failed', red())))
Thanks, Mike
Statement closing in the first condition it self, Try as follows
if([InspectionStatus]='Failed',rgb(242,0,0),if([InspectionStatus]='Passed',rgb(0,242,0),if([InspectionStatus]='Initial',rgb(0,0,242))))
Or
Pick(Match([InspectionStatus], 'Failed', 'Passed', 'Initial'), rgb(242,0,0), rgb(0,242,0),rgb(0,0,242))
Thanks, no errors on either but the bars are staying grey?
Use option for color as "Measure as Expression"
Should work, May be try with first expression? Can you please share sample application?
I tried this and still grey:
Pick(Match([InspectionStatus], 'Failed'), rgb(242,0,0))
i will check if i can share a sample, Thx, Mike
Here are the measure expressions if it helps:
Count({$<Bucket ={'Requested Inspections'}>*$<InspectionStatus = {'Initial'}>*$<InspectionType = {"*Hazard Elimination Assessment*"}>}distinct IMInspectionID)
Count({$<Bucket ={'Requested Inspections'}>*$<InspectionStatus = {'Failed'}>*$<InspectionType = {"*Hazard Elimination Assessment*"}>}distinct IMInspectionID)
Count({$<Bucket ={'Requested Inspections'}>*$<InspectionStatus = {'Passed'}>*$<InspectionType = {"*Hazard Elimination Assessment*"}>}distinct IMInspectionID)
With help from our BI team, we solved it by changing the measure expression to one instead of three, adding a bar inspection status dimension and the below color expression:
Count({$<Bucket ={'Requested Inspections'}>*$<InspectionType = {"*Hazard Elimination Assessment*"}>} distinct IMInspectionID)
if(InspectionStatus='Initial', blue(),
if(InspectionStatus='Passed', green(),
if(InspectionStatus='Failed', red())))
Thanks, Mike