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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
neon
Contributor II
Contributor II

search for blank or 'NA' in rows and return its respective column name

Search for blank or 'NA' in rows and return their respective field name else ' ' and concat them with ','  and I have 80 fields and return the output in a new single field.

sample ex-

A:
load*
Inline [
State,GSTIN,MS
ANDHRA PRADESH,345i,52
ASSAM,NA,''
BIHAR,'',3
NA,V1332,''
NA,NA,NA
'','',abc
'',tt,''
d,'',''
];

the output should look like-''

State GSTIN MS a
    abc State,GSTIN  
  tt   State,MS
ANDHRA PRADESH 345i 52     
ASSAM NA     GSTIN,MS
BIHAR   3   GSTIN  
d       GSTIN,MS
NA NA NA State,GSTIN,MS
NA V1332   State,MS

 

Labels (2)
1 Solution

Accepted Solutions
micheledenardi
Specialist II
Specialist II

i would suggest to do these calculation via load script... this works:

A:
Load *,
if(right(a_TMP,1)=',',left(a_TMP,len(a_TMP)-1),a_TMP)	as a;
load *,
 if(isnull(State) or trim(State)='' or upper(State)='NA','State,')&
 if(isnull(GSTIN) or trim(GSTIN)='' or upper(GSTIN)='NA','GSTIN,')&
 if(isnull(MS) or trim(MS)='' or upper(MS)='NA','MS') as a_TMP
Inline [
State,GSTIN,MS
ANDHRA PRADESH,345i,52
ASSAM,NA,''
BIHAR,'',3
NA,V1332,''
NA,NA,NA
'','',abc
'',tt,''
d,'',''
];
Drop Field a_TMP;

 

2022-03-07 15_23_59-Window.png

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
micheledenardi
Specialist II
Specialist II

i would suggest to do these calculation via load script... this works:

A:
Load *,
if(right(a_TMP,1)=',',left(a_TMP,len(a_TMP)-1),a_TMP)	as a;
load *,
 if(isnull(State) or trim(State)='' or upper(State)='NA','State,')&
 if(isnull(GSTIN) or trim(GSTIN)='' or upper(GSTIN)='NA','GSTIN,')&
 if(isnull(MS) or trim(MS)='' or upper(MS)='NA','MS') as a_TMP
Inline [
State,GSTIN,MS
ANDHRA PRADESH,345i,52
ASSAM,NA,''
BIHAR,'',3
NA,V1332,''
NA,NA,NA
'','',abc
'',tt,''
d,'',''
];
Drop Field a_TMP;

 

2022-03-07 15_23_59-Window.png

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.