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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do i calculate different conditions in the rows of the table.

I have a table , for eg:

Name Sales Revenues Status(Traffic lights)

A        100      200        (if sales> revenues - green) -----> a condition for traffic light

B         30        30         (if sales<revenues- yellow) ------> a diff condition....

How do i acheive the same???

Its a table with almost 15 Names and has differnent condition for each Status calculation.

14 Replies
qv_testing
Specialist II
Specialist II

Background color OR Text Color you can write condition like

if you have many condition use like this

if(sales>revenus, green(),

  if(sales<revenues, yellow(),

      if(sales=revenues, Blue(),

        if(sales >= revenus, color(),

         if( sales<=revenues, color(), elsepart color())

I think so, No other option, you can write like this........

Not applicable
Author

That is not the table i am working on .... that is just the sample data I posted.

And in status there will be only 2 values .. either 0 or 1 depending on the condition I give .

qv_testing
Specialist II
Specialist II

can you post sample application....

Not applicable
Author

these condition vary for each row(almost 15 rows)..

On which condition it is varying?

you need to write 15 if.. else conditions in edit expression

Not applicable
Author

For eg:

No.    Field1 Field2  Status

1        A         B       (if A>B , then 1 else 0)

2        C         D       (if C<D, or C=D, then 1 else 0)

3        E        F        (if E>F, or E=F, then 0 else 1) etc.....

.

.

.

15     Y          Z        (if Y>Z , then 1 else 0).

This is the format of the table i have got....