Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a requirement :
I have below data:
field1 | field2 |
---|---|
123 | 123:None |
456 | 456:None |
345 | 345:None |
now the values in colfield2 should be replaced with none ,
how to do that
its not working as none alone is not the value ,
its in combination with other digits,how to write in that
if(len(subfield(field1,:,2)),'',field1) as field2,
but ther is some mistake with this syntax ?
how to achieve the above
this was my code in SAS which am trying to replicate in qlik:
// CASE WHEN TRIM(SUBSTRING(field2,LENGTH(field1)+2)) = 'None' THEN NULL
// ELSE TRIM(SUBSTRING(field2,LENGTH(field1)+2))
// END
// AS field2 /*
how to achieve the above
kindly help and guide as its a urgent requirement
if(len(subfield(field1,:,2)),'',field1) as field2, missed single quotes in the expression i.e delimiter
NullTable:
Mapping Load None , Null() autogenerate 1;
Map Field2 using NullTable;
if(len(subfield(field1,':',2)),'',field1) as field2, -- try this
its not giving the desired output and its not taking the none value
// CASE WHEN TRIM(SUBSTRING(field2,LENGTH(field1)+2)) = 'None' THEN NULL
// ELSE TRIM(SUBSTRING(field2,LENGTH(field1)+2))
// END
// AS field2 /*
the above code needs to be replicated in qlik
try like this
if( subfield(feild2,':',2)='None','',subfield(feild2,':',1)) as feild2
thanks,
and if I need to replicate below in qlik:
Row_Number() OVER (PARTITION BY id ORDER BY date DESC) AS Rownum
rowno() as Rownum
this should do
will it be like:
Row_Number() OVER (PARTITION BY id ORDER BY date DESC) AS rowno()
but in qlik we don't have partition by and over