Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Traffic lights

Hi,

I have a bar chart with on the x-axis employeeID and on the y-axis is the sales

Now I want to make a traffic light which is green if EACH employee meets the target of 60 000 000 sales and red if they don't meet the target.

But how do I do this?

Can I use my bar chart for it or should I make a new gauge chart with exact the same data?

And we're can i say when it should be green or red?

Thanks in advance!

18 Replies
Not applicable
Author

I can't open it because i'm using personal edition.

It says if i want to repair it but than i won't be able anymore to open things with my one userid.

But i'll try to see if i can try it on another pc

Thanks a lot!

Not applicable
Author

in the traffic light use this

=If(sum({$<EmployeeID={1}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={2}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={3}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={4}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={5}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={6}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={7}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={8}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={9}>}Subtotal)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

'qmem://<bundled>/BuiltIn/led_g.png')))))))))

the example of the chart was this..

chart example.JPG

My personal view is that the chart does what you need in its own right..

But should you need to apply the traffic lights the formula should set you on your way.

Not applicable
Author

Thanks a lot, i understand it now!

One last question:

I've changed sum(subtotal) in to sales in my database, how should i write the if now?

Like this?

= If({$<EmployeeID={1}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

Not applicable
Author

That is right just replace the Subtotal with sales.... like this

=If(sum({$<EmployeeID={1}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={2}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={3}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={4}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={5}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={6}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={7}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={8}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If(sum({$<EmployeeID={9}>}Sales)<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

'qmem://<bundled>/BuiltIn/led_g.png')))))))))

Not applicable
Author

Should sum stay?

Cause sum(Subtotal) = sales

Not applicable
Author

yes sorry that is right...

so if you now have the sum figure as a single figure in your database this is fine..

sorry I should have read your post better..

Not applicable
Author

It doesn't work, i have:

=If({$<employeenumber={1}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={2}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={3}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={4}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={5}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={6}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={7}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={8}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

If({$<employeenumber={9}>}sales<100000, 'qmem://<bundled>/BuiltIn/led_r.png',

'qmem://<bundled>/BuiltIn/led_g.png')))))))))

I changed:

employeeID --> employeenumber

sum(subtotal) --> sales

i'm getting crazy, i guess

Not applicable
Author

Try putting the sum back in before the set.

This should work.

good luck

Not applicable
Author

That worked! Thanks a lot!

Would it also be possible to say at least 80 % of the employees has to meet the target?

If yes, how should I do that??