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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color by Expression Problem

Hello,

Todays challenge....

Dimension = BC (ex: A B C D)

Measures =

1) Level 0 YES - SUM(Aggr(If($(vLevel0Completion) = 'Y', 1, 0),[SID]))

2) Level 0 NO - SUM(Aggr(If($(vLevel0Completion) = 'N', 1, 0),[SID]))

I would like the Level 0 YES to be green in the visual below and Level 0 No as red. Please note that my measures are based off of variables.  Let me know if you have any ideas. Thanks!

1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi

may be like this

1 add in your script

[measure names]:

load * inline [

  measure

    Level 0 YES,

    Level 0 NO

  ]

2 then create a master mesure like this and call it Mymeasure

if(measure='Level 0 YES',SUM(Aggr(If($(vLevel0Completion) = 'Y', 1, 0),[SID])),

if(mesure='Level 0 NO',SUM(Aggr(If($(vLevel0Completion) = 'N', 1, 0),[SID]))))


3 then in your line chart add

dim =BC

dim = measure


measure = Mymesure (you pick your master mesure or copy past this above)

then in the color panel select by expression and add this

if(measure='Level 0 YES',green(),

if(mesure='Level 0 NO',lightred()))


hope it helps

View solution in original post

6 Replies
Not applicable
Author

Still looking for help on this problem. Does anyone have any idea?

brunobertels
Master
Master

Hi

may be like this

1 add in your script

[measure names]:

load * inline [

  measure

    Level 0 YES,

    Level 0 NO

  ]

2 then create a master mesure like this and call it Mymeasure

if(measure='Level 0 YES',SUM(Aggr(If($(vLevel0Completion) = 'Y', 1, 0),[SID])),

if(mesure='Level 0 NO',SUM(Aggr(If($(vLevel0Completion) = 'N', 1, 0),[SID]))))


3 then in your line chart add

dim =BC

dim = measure


measure = Mymesure (you pick your master mesure or copy past this above)

then in the color panel select by expression and add this

if(measure='Level 0 YES',green(),

if(mesure='Level 0 NO',lightred()))


hope it helps

Not applicable
Author

Thank you!! Let me try this!

idogridish2
Creator III
Creator III

Hi'

You can use

Valuelist('Level 0 YES','Level 0 NO')

See the Attached.

idogridish2
Creator III
Creator III

Hi mills8802,

Please mark the appropriate replies as CORRECT / HELPFUL so other members can know that your question has been answered to your satisfaction.

Not applicable
Author

Hello,

That did not work with what I was trying to accomplish. Thanks for trying though! I appreciate it!