Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i am writing this code
Load
orderdate, A, B,C from table1
Load
if(IsNull(EndDate),max(orderdate),EndDate) as EndDate,
StartDate,
TerritoryID From
Table2
the above code gives error?? how to solve it?
thanks
Lavi
Lukasarn,
i have done by creating Temporary table
Temp:
LOAD
num(max(OrderDate)) as MaxDate
Resident Table1;
LET vMaxDate = peek('MaxDate', 0, 'TEMP');
Drop Table Temp;
Now i can use this variable VMaxDate any where.
thanks for your kind help
Regards
Lavi
Hello lavi,
i think you have to map the orderdate in table2
than you can write:
Load
if(IsNull(EndDate),max(orderdate),EndDate) as EndDate,
*;
Load
(mapping orderdate) ,
EndDate,
StartDate,
TerritoryID
From
Table2
Lukasarn,
thanks for response,
but u have loaded this statement
if(IsNull(EndDate),max(orderdate),EndDate) as EndDate
in first table. but i am loading this statement in second table.
and also
Load (mapping orderdate) format is not correct i guess Mapping Load is correct.
thanks
Lavi
Do the tables have a relation?
table1:
Load
orderdate,
A,
B,
C
from
table1;
Mappingtable:
Mapping Load ......
table2:
Load
if(IsNull(EndDate),max(orderdate),EndDate) as EndDate,
*;
Load
apply map .... ,
EndDate,
StartDate,
TerritoryID
From
Table2
of course (mapping orderdate) is not the right syntax ,it should only show you where you have to write it.
hello sardar ji,
post a clear requirement what u want
no table does not have any relation.
and what to write after apply map .... , in your answer??
thanks
Lavi
hello lavi ,
now u are on right track u can store it into variable and use anywhere u want .
Hi,
Yes you are able to put Max(orderdate) in variable like vOrderVar = Max(orderdate) and where ever you use in the application you are able to use it.
Regards
Anand
Hi,
Try this.
Table1:
Load
orderdate, A, B,C
from table1;
Temp:
Load Max(orderdate) as Max
Resident Table1;
Let vMax = peek('Max',0,'Temp');
Drop table Temp;
Table2:
Load
if(IsNull(EndDate),$(vMax),EndDate) as EndDate,
StartDate,
TerritoryID
From Table2
Regards,
Kaushik Solanki