Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to create a flag for all items if it has been purchased in any previous fiscal year.
table looks like this
load
item_id,
price,
Date,
Fiscal_year
from Table1;
Hi Avneet,
Try this:
load
item_id,
price,
Date,
Fiscal_year,
if(Fiscal_year=year(now())-1,1,0) as flag
from Table1;
G.
HI,
Gabor is nearly there.
if(Fiscal_year<=year(now())-1,1,0) as flag
Needs to be less than or equal to current year -1
Mark
Hi Mark,
you are right, I was inattentive to the post
A little tailoring:
if(Fiscal_year<year(now()),1,0) as flag
G.