Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have SQL table, how to set up , if the value is " null " written 1. Using my script i'm i get value "-"
/Sample/
[products]:
LOAD ID as [item.ID],
Name as [pr.name],
Code as [pr.code],
TareWeight as [pr.twt],
if ((TareWeight='Null') or (TareWeight=0),1,TareWeight) as [Weight]
;
SQL SELECT *
FROM postgres."public".erpoitm
try this:
[products]:
LOAD ID as [item.ID],
Name as [pr.name],
Code as [pr.code],
TareWeight as [pr.twt],
if(len(TareWeight)>0, TareWeight, 0) as [Weight]
;
SQL SELECT *
FROM postgres."public".erpoitm
Marc.
Hi,
you can write in SQL itself.
Select isnull(TareWeight,1) as TareWeight from postgres."public".erpoitm.
Hi,
LOAD ID as [item.ID],
Name as [pr.name],
Code as [pr.code],
TareWeight as [pr.twt],
alt(TareWeight,1) as [Weight],
if(isnull(TareWeight),1,TareWeight) as [Weight_NEW]
;
SQL SELECT *
FROM postgres."public".erpoitm
Alt(TareWeight,1) as [Weight]
try this:
[products]:
LOAD ID as [item.ID],
Name as [pr.name],
Code as [pr.code],
TareWeight as [pr.twt],
if(len(TareWeight)>0, TareWeight, 0) as [Weight]
;
SQL SELECT *
FROM postgres."public".erpoitm
Marc.
Thanks all for yours answers, resolved
Hi Aurimas,
You could also use the following
NullAsValue TareWeight;
SET NullValue = 1;
Thanks
Mark
https://www.techstuffy.com/course/practical-qlikview-qlikview-beginners/