Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
New-Qlik
Creator III
Creator III

Creating flag

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;

3 Replies
undergrinder
Specialist II
Specialist II

Hi Avneet,

Try this:

load

item_id,

price,

Date,

Fiscal_year,

if(Fiscal_year=year(now())-1,1,0) as flag

from Table1;

G.

Mark_Little
Luminary
Luminary

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

undergrinder
Specialist II
Specialist II

Hi Mark,

you are right, I was inattentive to the post

A little tailoring:

if(Fiscal_year<year(now()),1,0) as flag 

G.