Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i would create a variable dividing the year in 2 - 3 - 4 - 5 months.
a field "data" is colled DATE_ORD - YYYY/MM/GG
How could I do?
2 months:
gen - feb
mar - apr
mag - giu
lug - ago
set - ott
nov - dic
3 months:
gen - feb - mar
apr - mag - giu
lug - ago -set
ott - nov - dic
4 month
gen - feb - mar - apr
mag - giu lug - ago
set - ott - nov - dic
6 months
gen - feb - mar - apr - mag - giu
lug - ago - set - ott - nov - dic
Something like
LOAD *,
Ceil( Month(DATE_ORD) / 2 ) As TwoMonthPeriod,
Ceil( Month(DATE_ORD) / 3 ) As ThreeMonthPeriod,
Ceil( Month(DATE_ORD) / 4 ) As FourMonthPeriod,
Ceil( Month(DATE_ORD) / 6 ) As SixMonthPeriod;
LOAD Date#(DATE_ORD,'YYYY/MM/DD') as DATE_ORD
FROM YourTableSource;
looking your code should be fine
I'm using it during reload data function. Is it correct?
Because "the command Ceil is a value unrecognized.
ah, i'm using an sql table
Is that the error you get when reloading?
ceil() is a numeric function and should work in a QV LOAD statement. Could you post your script or document log?
select
campo1
,campo2
,campo3
from nomedatabase.[dbo].[nometabella]
You need to use the QV functions in a preceding LOAD statement:
LOAD *,
Ceil( Month(DATE_ORD) / 2 ) As TwoMonthPeriod,
Ceil( Month(DATE_ORD) / 3 ) As ThreeMonthPeriod,
Ceil( Month(DATE_ORD) / 4 ) As FourMonthPeriod,
Ceil( Month(DATE_ORD) / 6 ) As SixMonthPeriod;
LOAD Date#(DATE_ORD,'YYYY/MM/DD') as DATE_ORD;
SQL SELECT ....
FROM YourTableSource;
hi,
but the field DATE_ORD is extracted by a select (sql).
I tried to put them after but, i receive a syntax error (FROM is missing
SQL SELECT
[DATE_ORD]
FROM [DATABASE].[dbo]. LOAD *, Ceil( Month(DATE_ORD) / 2 ) As TwoMonthPeriod, Ceil( Month(DATE_ORD) / 3 ) As ThreeMonthPeriod, Ceil( Month(DATE_ORD) / 4 ) As FourMonthPeriod, Ceil( Month(DATE_ORD) / 6 ) As SixMonthPeriod; LOAD Date#(DATE_ORD,'YYYY/MM/DD') as DATE_ORD;;
That's why a called it a preceding LOAD statement:
LOAD *,
Ceil( Month(DATE_ORD) / 2 ) As TwoMonthPeriod,
Ceil( Month(DATE_ORD) / 3 ) As ThreeMonthPeriod,
Ceil( Month(DATE_ORD) / 4 ) As FourMonthPeriod,
Ceil( Month(DATE_ORD) / 6 ) As SixMonthPeriod;
LOAD Date#(DATE_ORD,'YYYY/MM/DD') as DATE_ORD;
SQL SELECT
[DATE_ORD]
FROM [DATABASE].[dbo].;
OK
It works