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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chinnu3
Contributor III
Contributor III

I want to take only duplicate values which has one date field is available and another field should be blank

Hi All,

I have data as 

ID Date
12 -
13 1/2/2022
13 -
14 2/2/2022
14 3/2/2022

 

I want to take only duplicate values which has one date field is available and another field should be blank

Example:- ID 13 has date(1/2/2022) and another 13 has No date(blank). I don't want to consider ID 14(it has both dates).

Thanks in advance.

5 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @Chinnu3 ,

Please try below create below dimension and use it in the set analysis

if(count(DateD)=1 and Count(ID)>=2,'Yes','No') 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Chinnu3
Contributor III
Contributor III
Author

I want to add this one in script and i tried what you have given in above, but it didn't work. Could you please give me any other solution please.

 

abhijitnalekar
Specialist II
Specialist II

Hi @Chinnu3 ,

Can you try below in a table directly? it's working as expected at my end.

abhijitnalekar_0-1644321848295.png

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
Chinnu3
Contributor III
Contributor III
Author

It's working on frontend, but I need that in script and that too i want to add this in preceding load based on requirement to filter, could you please tel me how to do that..
thank you.

brunobertels
Master
Master

Hi 

 

Try this in script 

 

[Temp]:
LOAD * INLINE
[
ID,Date
12,-
13,1/2/2022
13,-
14,2/2/2022
14,3/2/2022
](delimiter is ',');

Table:
noconcatenate
Load
ID
//[Date] ,

resident Temp where Date='-';
//order by ID,Date desc ;

inner Join
Load
ID,
Date
resident [Temp] where Date<>'-' ;

noconcatenate
final:
load *resident Table where Date<>'-';

drop table Temp;
drop table Table;

 

resulting Table : 

brunobertels_0-1644408398761.png