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: 
Not applicable

Backend Null()

I have a dimension in which sometime the value is coming null...

Suppose FM= -

PM= 6

CM=PM + FM(6 + null = null) = null

now when i am putting  condition (if CM= NULL() ,0 , CM)

CM is still coming -      i.e CM= -

i need zero here

can someone help me

4 Replies
its_anandrjs
Champion III
Champion III

Hi,

Try with

if(CM = NULL() Or CM='-' ,0 , CM)

Regards,

Anand

Not applicable
Author

NAAH NOT WORKING

its_anandrjs
Champion III
Champion III

Hi,

Provide any sample file but it is worked on my end see this example

LOAD if(FM = NULL() Or FM='-' ,0 , FM) as NewField,

FM,PM;

LOAD * Inline

[

FM,PM

-,6

1,7

5,8

];

In.png

Regards

Anand

maxgro
MVP
MVP

3 different solution to solve this

alt

len trim

rangesum

a:          // test data

load   null() as FM,  6 as PM

autogenerate 1;

load       // solutions

  alt(FM,0) + PM                               as solution1,

  if(len(trim(FM))=0, 0, FM) + PM        as solution2,

  rangesum(FM, PM)                         as solution3

Resident   a;