Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I almost got the script with logic but somewhere "J" is taking wrong values instead of 18.
Advise me modifications or new lines ...
************************************************************************
SOURCE:
LOAD Q1,
Q2,
Q3
FROM
[.......................................]
(ooxml, embedded labels, table is Sheet2);
LET Vreplace='OK';
LET VCOLNO = NoOfFields('SOURCE'); // Countng number of columns
FOR I = 1 TO NoOfFields('SOURCE') //
let vFieldname=0;
let vFieldname = Fieldname($(I),'SOURCE'); //
for J = 1 to FieldvalueCount('$(vFieldname)') // Getting in to each column(field).
IF(FieldValue('$(vFieldname)',$(J))='N/A') then //searching in each Feild....
SignificantRecords:
LOAD
FieldValue('$(vFieldname)',$(J))='NO' as newvalue;
End if;
next J
//Let vNumRecords =0;
next I
LET VCOLNO=0;
//*******************************************************************************
Look at marcus_sommer's response at this thread:
How to modify the same values in more than hundred distinct fields?
Could you please help me understand why you are not using Replace function ie Replace(s, fromstring ,tostring)
>>My target is to eliminate 'N/A' and repalce with 'NO'.
Do you want to keep same columns and rows?
Maybe you want to try this:
Map:
Mapping LOAD * Inline [
From, To
N/A, NO
];
MAP Q1,Q2,Q3 using Map;
SOURCE:
LOAD Q1,
Q2,
Q3
FROM
[https://community.qlik.com/servlet/JiveServlet/download/1135616-248083/SURVEY.xlsx]
(ooxml, embedded labels, table is Sheet2);