Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pala_jagadeesh
Contributor III
Contributor III

select only true condition

Hi I have table with three columns, i want to show only true condition if there is true and false condition for same ID

if there is one condition for ID, it come as it is like below output

ID names condition
1 abc;aba;bca yes
1 abc;aba;bca No
2 fff;lll;mmm yes
2 fff;lll;mmm No
3 qqq;www;rrr No
3 qqq;www;rrr yes
4 kkk;ooo NO
5 ggg;aaa;zzz NO

 

Output

ID condition  
1 yes  
2 yes  
3 yes  
4 NO  
5 NO  
Labels (4)
2 Solutions

Accepted Solutions
PrashantSangle

renaming your first field as row(field name must be unique in table)

take table

dimension> row, condition

measure > Only({<condition={"YES"}>+<names={"=count({1}row)=1"}>}names)

PrashantSangle_0-1661146032059.png

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

Afa_Momin
Contributor II
Contributor II

Done,Try the following code

 

TRUE:
load * inline [
ID,names,condition
1,abc;aba;bca,Yes
1,abc;aba;bca,No
2,fff;lll;mmm,Yes
2,fff;lll;mmm,No
3,qqq;www;rrr,No
3,qqq;www;rrr,Yes
4,kkk;ooo,No
5,ggg;aaa;zzz,No
];

T:
Load Distinct
ID as New_ID
Resident TRUE
where condition = 'Yes';

T1:
Load Distinct
ID as ID1,
names,
If(Exists(New_ID,ID),'Yes','No') as cond
Resident TRUE;

Drop Table TRUE;

 

Use ID1,names,cond as dimension in frontend

View solution in original post

10 Replies
PrashantSangle

renaming your first field as row(field name must be unique in table)

take table

dimension> row, condition

measure > Only({<condition={"YES"}>+<names={"=count({1}row)=1"}>}names)

PrashantSangle_0-1661146032059.png

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
pala_jagadeesh
Contributor III
Contributor III
Author

@PrashantSangle ,

There is small change in Output, I want those results in front end

PrashantSangle

the expression is for front end only

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
pala_jagadeesh
Contributor III
Contributor III
Author

Hi @PrashantSangle 

The above results shown names based on condition values,

But I want condition values based on names

please check the tables once

the above expression shows only Yes condition values only

Afa_Momin
Contributor II
Contributor II

Done,Try the following code

 

TRUE:
load * inline [
ID,names,condition
1,abc;aba;bca,Yes
1,abc;aba;bca,No
2,fff;lll;mmm,Yes
2,fff;lll;mmm,No
3,qqq;www;rrr,No
3,qqq;www;rrr,Yes
4,kkk;ooo,No
5,ggg;aaa;zzz,No
];

T:
Load Distinct
ID as New_ID
Resident TRUE
where condition = 'Yes';

T1:
Load Distinct
ID as ID1,
names,
If(Exists(New_ID,ID),'Yes','No') as cond
Resident TRUE;

Drop Table TRUE;

 

Use ID1,names,cond as dimension in frontend

pala_jagadeesh
Contributor III
Contributor III
Author

Hi @Afa_Momin ,

How can we get these  ouput in front end

PrashantSangle

Hi @pala_jagadeesh ,

did you try that expression which I have suggest. It is giving the same result which you are asking for.

What is output you got when you apply that expression.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Afa_Momin
Contributor II
Contributor II

YesTry and seeTry and see

pala_jagadeesh
Contributor III
Contributor III
Author

@PrashantSangle ,it gives only Yes values