Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

dilipkumard12
New Contributor II

By Expression color in qliksense.

i tried this below expression.

=if(Date(Date_1)>Today(),If((NetWorkDays(Date(Date_1),Today()))<10,'0-10',If((NetWorkDays(Date(Date_1),Today()))<20,'10-20','+20')),

If(((NetWorkDays(Date(Date_1),Today()-1))<10)*-1,'0-(10)',

If(((NetWorkDays(Date(Date_1),Today()-1))<20)*-1,'(10)-(20)','(20)+')))

we required + Values should be Green() and - Values be in Red.

11 Replies
mdmukramali
Valued Contributor II

Re: By Expression color in qliksense.

Hi Dilip,

=if you are using the same expression in Measure then you can try something like this in Color By Expression :

if(Column(1)>0,Green(),red())

if different expression in the Measure then can you check you're if condition.

=if(Date(Date_1)>Today() AND  If((NetWorkDays(Date(Date_1),Today()))<10,'0-10',

           if(Date(Date_1)>Today() AND If((NetWorkDays(Date(Date_1),Today()))<20,'10-20','+20')),

If(((NetWorkDays(Date(Date_1),Today()-1))<10)*-1,'0-(10)',

If(((NetWorkDays(Date(Date_1),Today()-1))<20)*-1,'(10)-(20)','(20)+')))

Thanks,

Mukram

dilipkumard12
New Contributor II

Re: By Expression color in qliksense.

Thank you for comment.

we tried but not expected results

vikasmahajan
Honored Contributor III

Re: By Expression color in qliksense.

Which Version you are using probably if it is old , you are not able to get color by expression try to load latest version and check.

Vikas

mdmukramali
Valued Contributor II

Re: By Expression color in qliksense.

Hi,

can you attach sample file let me check the if condition

Thanks,

Mukram.

dilipkumard12
New Contributor II

Re: By Expression color in qliksense.

Qliksense 3.2 SR4

dilipkumard12
New Contributor II

Re: By Expression color in qliksense.

we can not attach the file . its confidential

dilipkumard12
New Contributor II

Re: By Expression color in qliksense.

Thank you for your reply.

I'm using in Dimension.

vanand3535
Contributor

Re: By Expression color in qliksense.

How to chnage color in qlik sense by expression:-

Hi,

Here I have attached a simple example how to change the color of graph based on expression in qlik sense

In my example ,

Dimesion-----year(2009,2010,2011,2012)

Measure----Sales(Sum)

Go to:----

Appereances----colors and legands--------colors(select custom)---by expression-----

then apply whatever condition you want to apply in graph.

I have given simple example of expression:

if(Year='2009',Blue(),Yellow())

Screenshot (529).png

Screenshot (530).png

dilipkumard12
New Contributor II

Re: By Expression color in qliksense.

thank you vivek anand,

Im Using calculated Dimension as

=if(Date(Date_1)>Today() AND  If((NetWorkDays(Date(Date_1),Today()))<10,'0-10',

           if(Date(Date_1)>Today() AND If((NetWorkDays(Date(Date_1),Today()))<20,'10-20','+20')),

If(((NetWorkDays(Date(Date_1),Today()-1))<10)*-1,'0-(10)',

If(((NetWorkDays(Date(Date_1),Today()-1))<20)*-1,'(10)-(20)','(20)+')))

Please suggest.

Community Browser