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

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
FGuijarro
Contributor III
Contributor III

Expression depending on a condition

Hi,

I´ve developed a job in which I calculate price1 depending on 4 conditions.

 

IF those 4 conditions are "N", "Y", "Y", "Y" THEN

 

0695b00000GfUTUAA3.jpg 

IF those conditions are other different than "N", "Y", "Y", "Y" THEN

 0695b00000GfdJhAAJ.jpgDepending on those 4 conditions, Price1 will be calculated with maximun_1 or with maximun_2.

I´ve wrote in the tmap the expression for the price_1 using maximun_1 or maximun_2 but it doesn´t work.

Does anybody can help me, please?

Thank you so much!!

 

Conditions:

condition_1: row4.prefijo == null?"N":"Y" 

condition_2: row5.pais == null?"N":"Y" 

condition_3: row6.precio_referencia_ge == null?"N":(row3.referencia == null||row3.referencia == 0)?"N":((row3.referencia-row6.precio_referencia_ge)*100)/(row3.referencia)>20?"Y":"N" 

condition_4: row7.counter == null?"N" : row7.counter>2?"Y":"N" 

 

Expression for "maximun_2"

(row4.prefijo == null)&&((row6.precio_referencia_geco == null?"N":(row3.referencia == null||row3.referencia == 0)?"N":

((row3.referencia-row6.precio_referencia_geco)*100)/(row3.referencia)>20?"Y":"N").equalsIgnoreCase("Y"))&&((row7.counter == null?"N" : row7.counter>2?"Y":"N").equalsIgnoreCase("Y"))&&(row5.pais != null)?row3.second_maximo:row3.maximo 

 

Expression for price1 is:

((((row12.minimo==null?0:row12.minimo )*1.6)-(row12.maximo==null?0:row12.maximo ))>=0)?(row12.minimo==null?0:row12.minimo ):((row12.maximo==null?0:row12.maximo)/1.6)

 

 

0695b00000GfdDtAAJ.png

Labels (3)
1 Reply
Anonymous
Not applicable

Hi

You don't get expected result or the expression does not work? To debugging the result, I would suggest to add new columns in the output table like condition1, condition2, condition3, condition4, maximun_2 and calculate the values of these columns, finally, simplify the expression of price1 column.

 

Regards

Shong