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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Adding IF Clause expands X-Axis

Hello,

I am working with a bar chart on the web version of Qlik Sense.  The code below is how I colored the graph by expression produced in the attached photo, 'V1.jpg'. However, when I remove the comment markers, the graph in 'V2.jpg' is produced. The coloring is correct, but now my graph no longer ranges from 0 to 20. How do I get the coloring, AND the 0 to 20 x axis at the same time?

//IF(WeeksToEvent > 10,

IF(PICK(vConcert,

SUM({$<WeeksToEvent = {">=$(vWeekstoConcert)"}>*$<WeeksToEvent = {"<=$(vWeekstoConcert)+20"}>*$<EventName = {'A'}>}QtySeat),

SUM({$<WeeksToEvent = {">=$(vWeekstoConcert)"}>*$<WeeksToEvent = {"<=$(vWeekstoConcert)+20"}>*$<EventName = {'B'}>}QtySeat))

-

PICK(vConcert2,

SUM({$<WeeksToEvent = {">=$(vWeekstoConcert)"}>*$<WeeksToEvent = {"<=$(vWeekstoConcert)+20"}>*$<EventName = {'A'}>}QtySeat),

SUM({$<WeeksToEvent = {">=$(vWeekstoConcert)"}>*$<WeeksToEvent = {"<=$(vWeekstoConcert)+20"}>*$<EventName = {'B'}>}QtySeat))

>0,

GREEN(),

RED()

)

//,BLACK())

Thanks!

0 Replies