Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sspawar88
Contributor

Creating Valid Script for two tables.

Hi,

In bar Chart i'm using following expression.

if(param_name='TEMP' and (param_value)<='-1' and (param_value)>= '-10', 'Red',

if(param_name='TEMP' and (param_value)<= '-10.1' and (param_value)>='-13.9', 'Yellow',

if(param_name='TEMP' and (param_value)<= '-14' and (param_value)>='-17.9', 'Amber',

if(param_name='TEMP' and (param_value)<= '-18', 'Green'))

))

above Expression is works at script in Qlikview but not works in Qlik sense?

Can you please assist this in Qlik sense?

5 Replies
rnt
Valued Contributor

Re: Creating Valid Script for two tables.

I think you need to describe more what you want to achieve. In which property of the bar chart do you use this expression?

sspawar88
Contributor

Re: Creating Valid Script for two tables.

stack bar chart. but by using this at UI level implies extra load on Application..and when i use it at Script it gives incorrect value in Qlik sense but correct in Qlikview.

rnt
Valued Contributor

Re: Creating Valid Script for two tables.

Do you have a script example?

sspawar88
Contributor

Re: Creating Valid Script for two tables.

LOAD

  if(param_name = 'Temperature',

      if(param_value <= -18, 'D',

       if(param_value >= -17.9 and param_value <= -14 , 'C',

           if(param_value >= -13.9 and param_value <= -10.1 , 'B',

            if(param_value >= -10 and param_value <= -1, 'A'))))) AS BANDS

resident iot_tx_data;

Above script works in Qlikview not in Qlik sense


i.e    Gives correct data as per this script in qlikview.

        Qlik sense gives wrong data.

rnt
Valued Contributor

Re: Creating Valid Script for two tables.

Do you have some input data, and expected output data?

iot_tx_data:

LOAD * INLINE [

param_name, param_value

Temperature, -17

Temperature, -19

Temperature, -1

Something else,9

];

bands:

LOAD

  if(param_name = 'Temperature',

      if(param_value <= -18, 'D',

       if(param_value >= -17.9 and param_value <= -14 , 'C',

           if(param_value >= -13.9 and param_value <= -10.1 , 'B',

            if(param_value >= -10 and param_value <= -1, 'A'))))) AS BANDS

resident iot_tx_data;

This gives C, D, A and a Null as output in BANDS, as I would expect to.