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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
MJlassi
Contributor
Contributor

if - chart function

Hello,

Can someone help with the below?

I have the following data:

qlik.PNG

the desired result is as follows:

Qlik2.PNG

I would like to develop an expression that serves to reach the column 'EXP'

Thank you in advance for your help.

2 Solutions

Accepted Solutions
QFabian
MVP
MVP

Hi @MJlassi ,  please check this formula, i just created a straight table with the two dimnsions, and one expression :

 

if(rowno()=1 and left(Test, 2) = 'OK', 'THIS',
if( left(Test, 2) = 'OK' and Code = above(Code)and above(column(1)) <> 'THIS' and above(above(column(1))) <> 'THIS',
'THIS', 'NOT THIS'))

QFabian_0-1621892818640.png

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.

View solution in original post

Saravanan_Desingh

Try this in Script,

tab1:
LOAD * INLINE [
    Code, Test
    A, OKK
    A, KO
    B, OKKK
    B, KO
    B, KO
    C, OK
    C, OKK
    C, OKKK
    C, KO
];

Left Join(tab1)
LOAD Code, Concat(DISTINCT '@'&Test&'@') As C1
Resident tab1
Group By Code;

Left Join(tab1)
LOAD Code, Test, If(Test='OK' Or (Test Like '*OK?*' And Index(C1,'@OK@')=0),'THIS','NOT THIS') As EXP
Resident tab1
;

Drop Field C1;

View solution in original post

3 Replies
QFabian
MVP
MVP

Hi @MJlassi ,  please check this formula, i just created a straight table with the two dimnsions, and one expression :

 

if(rowno()=1 and left(Test, 2) = 'OK', 'THIS',
if( left(Test, 2) = 'OK' and Code = above(Code)and above(column(1)) <> 'THIS' and above(above(column(1))) <> 'THIS',
'THIS', 'NOT THIS'))

QFabian_0-1621892818640.png

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
Saravanan_Desingh

Try this in Script,

tab1:
LOAD * INLINE [
    Code, Test
    A, OKK
    A, KO
    B, OKKK
    B, KO
    B, KO
    C, OK
    C, OKK
    C, OKKK
    C, KO
];

Left Join(tab1)
LOAD Code, Concat(DISTINCT '@'&Test&'@') As C1
Resident tab1
Group By Code;

Left Join(tab1)
LOAD Code, Test, If(Test='OK' Or (Test Like '*OK?*' And Index(C1,'@OK@')=0),'THIS','NOT THIS') As EXP
Resident tab1
;

Drop Field C1;
Saravanan_Desingh

Output:

commQV74.PNG