Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to use the If function, but when I reload the script it appears a message that says Script line error:
if(num(month(today())) = 1)
The script is the following:
if(num(month(today())) = 1)
//si es enero, considero el cambio de año como un caso particular
//genera el QVD correspondiente a diciembre del año pasado
Año = year(today()) - 1;
Transacciones_ACA_Sum:
NOCONCATENATE
LOAD
FFECHA,
SKU,
NODO,
Sum(CAJAS) as CAJAS,
Sum(NIV) as NIV,
Sum(KILOS) as KILOS
RESIDENT Transacciones_TPM
WHERE YEAR(FFECHA) = $(Año) AND MONTH(FFECHA) = 12
GROUP BY
FFECHA,
SKU,
NODO;
STORE Transacciones_ACA_Sum INTO $(vPathBase)\QVD\Transacciones_ACA_Sum\Transacciones_ACA_Sum_$(Año)_12.QVD;
DROP TABLE Transacciones_ACA_Sum;
I thing I´m writing bad the If condition, what do you think?
Thanks,
Francisco
Maybe you just forgot the "then" and end if
Try this
if(num(month(today))=1) then
youre code
end if
the syntax for if is :
IF( condition, value_if_condition_is_true, value_if_condition_is_false)
IF(0=1, 'dog', 'cat') is 'cat'
it works like the ternary operator "?" in C
Thanks, I tried to do that, but appears the following message:
Script line error:
if(num(month(today())) = 1)
Unknown statement
then
Año = year(today()) - 1
Thanks
Francisco