Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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.