Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Krish2459_58
Creator II
Creator II

Script help

Hi, I have data like below.

I want to show the Products for ID's where Product ='Apple' as null().

In this below example ID =1 has both Apple and Banana so I want to show null. Please see the below "Required output" column.

 

ID Product
1 Apple
1 Banana
3 orange
4 carrot
5 Apple
5 Pineapple
6 Apple
   
   
Required Output
ID Product
1 null()
3 orange
4 carrot
5 null()
6 null()
Labels (1)
2 Replies
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Krish2459_58 

Normal Table > ID as Dimension and then below is the measure 

IF(Count(distinct Product) > 1, 'Null()', Product)

I'm just not understanding why ID 6 is null on your output table? 

Regards Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

Chanty4u
MVP
MVP

Try this 

If(Aggr(Count({<Product={'Apple'}>} Product), ID) > 0, Null(), Product)