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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

new feild with null values

hi,

i build new feild in the script with an existing feild.

but in some cases the feild is null.

how i need to write it in the script ?

 

this is what i wrote :

if(Match([agent],500,504,509,506,505,503,502,508,null),'בנייה',
if(Match([agent],507),'תעשייה',
if(Match([agent],510),'ייצוא'))) as [תאור קוד סוכן - דוח 5]

,

thanks'

yarin.

5 Replies
swuehl
MVP
MVP

Try like this:

if(Match([agent],500,504,509,506,505,503,502,508) or len(trim([agent]))=0,'בנייה',
if(Match([agent],507),'תעשייה',
if(Match([agent],510),'ייצוא'))) as [תאור קוד סוכן - דוח 5]

Anonymous
Not applicable
Author

hi,

it doesn't work.

now i get 2 gruops the all feild together , and the null feild alone.

i need the the nuul feild will be with the first gruop.

do you have any idea ?

Not applicable
Author

Hi,

Is 'NULL' value you have in Agent field or it like empty cell..?

If you have empty cells under Agent field insted of putting 'null' do like this ' ' else if you have value null put like this 'null'

hope it helps!!..

Anonymous
Not applicable
Author

hi. still doesn't work.

swuehl
MVP
MVP

Seems to work ok for me (just using an empty agent value for demonstration instead of a NULL, but len(trim(agent)) should handle both):

LOAD *,

if(Match([agent],500,504,509,506,505,503,502,508)or len(trim(agent))=0,'בנייה',

if(Match([agent],507),'תעשייה',

if(Match([agent],510),'ייצוא'))) as [תאור קוד סוכן - דוח 5]

INLINE [

agent, field

500,1

504,2

,3

509,4

507,5

508,6

510,7

]