Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
New-Qlik
Creator II
Creator II

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.