Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if there no values in database i want to replace it by 0
Replace(ID,'','0') as ID
i am using this formula in script but i did't getting the answer.
Try this:
If(Len(Trim(ID)) = 0, 0, ID) as ID
Hi:
Try this Replace(ID,null(), 0) as ID
Joaquín
check this as well, might be helpful for you?
How to replace Null() by a string value?
https://community.qlik.com/ideas/1905
you can try like this too
If(ID = '' or ID=null() or isnull(ID), 0, ID) as ID
Dear sunindia
Tbl 1
ID Sales
1 100
2 200
3 300
4 400
Tbl 2
ID Lockperiod
1 1
2 2
3 4
see ID 4 doesn't have lock period so in this case i want 0 as lock period for ID 4
Are you joining the two tables to add 0? How would table 2 know that there is a 4 that exists?
Try like this :
Tbl 1
ID Sales
1 100
2 200
3 300
4 400
Tbl 2
ID Lockperiod
1 1
2 2
3 4
Temp:
LOAD ID as Key
resident
Tbl 2;
concatenate(Tbl 2)
LOAD ID ,
0 as Lockperiod,
resident
Tbl 1
where not exist(Key ,ID);
If the ID is not matching with table 2 then for this ID i want to display lock period as 0