Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error

Hi,

there is one variable vMaxDate  , which is created by taking first row from date field .

As the date field is blank so script is failing at Date > $(vMaxDate), but we want to ignore the TAB1 load on first TAb of script and move to second TAb and load Table2.

First TAb in script---

TAB1:

LOAD

RET,

Date,

Value

from Table1 where Date > $(vMaxDate);

Second TAb in script---


TAB2:

LOAD

RES,

Date,

Amt

from Table 2;

We can do it by SET ErrorMode = 0;

but is there any other way to do it or we want something like if $(vMaxDate) is null the SET ErrorMode = 0 else 1

5 Replies
Anil_Babu_Samineni

but is there any other way to do it or we want something like if $(vMaxDate) is null the SET ErrorMode = 0 else 1


From here, What was the condition seems this, But what the vMaxDate here simple Max(Date) or what?


If($(vMaxDate) = Null(), 0, 1) as ErrorMode

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You can try with the following WHERE clause for TAB1 (add quotes)


:

from Table1 where Date > '$(vMaxDate)';

:


First time around, this code will load all rows. If that's not what you want, set the default value for vMaxDate to some exceptionally high date value that none of the available Dates will match.

Best,

Peter

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

What you can do is put your script in if statement like below.

If not isnull($(vMaxDate)) then

Load from table 1

Else

Load from.table 2

End if

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sdmech81
Specialist
Specialist

Hi,

May be even if values in vmaxDate there or not and you want to run table 2 then You can try like this:

Here not adding anything btn else and end if bcs we don't want it to do anything If vmax Date id null..Plss Try and let me know.Hope it helps

If not isnull($(vMaxDate)) then

Load from table 1

Else

end if

Load from.table 2

sdmech81
Specialist
Specialist

And really avoiding error mode helps I guess bcs wt if it throws error bcs of some othr issue

Sachin