8 Replies Latest reply: Feb 29, 2012 11:14 AM by Rob Wunderlich

Dear Community,

is there somehow a chance to set all to be uploaded data that is = 0 as ' ' (blank field) in the script?

My current workaround is to:

if(@4=0,'',@4) as Jan,

if(@5=0,'',@5) as Feb,

if(@6=0,'',@6) as Mae,

... which obviously can't be the solution. ;-)

Thanks in advance and best regards,

donuteater

Hi,

As of me making 0 to '' blank field in single code is not possible.

You can do it by checking like your approach only.

if(@4=0,'',@4) as Jan,

if(@5=0,'',@5) as Feb,

if(@6=0,'',@6) as Mae,

this one.

Celambarasan

Hi,

You can try

if(@4=0, null(),@4) as Jan,

if(@5=0,null(),@5) as Feb,

if(@6=0,null(),@6) as Mae,

Regards,

Jagan.

The problem is, that my lineal regression is totally useless, since i've only got values for the first 4 months. May to December are taking into the calculation with a zero, which gives a straight downward trend.

Dou you perhaps have any other ideas how to fix this issue?

donuteater,

you could probably handle the zero values in your expressions, I think your issue is somewhat similar to the discussion John had here:

http://community.qlik.com/message/103596

Maybe I am wrong though..

You could use a mapping table.

ZeroMap:

MAPPING LOAD 0, '' AutoGenerate 1;

MAP Jan USING ZeroMap;

MAP Feb USING ZeroMap;

etc

-Rob

http://robwunderlich.com

Good idea, Rob!

Instead of defining each field mapping in a separate statement, I believe we could also use

MAP Jan, Feb, Mae USING ZeroMap;

or even

MAP * USING ZeroMap;

right?

Could you please explain, what the single command lines do?