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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need Help with Variable

Hi Guys

I am trying to put n a Variable but do not know how to do this.

I want a Flag if in the last 4 months CreatedDate was more than 4 months old to say Y and Older than 4 months to say N

I have attached a Test Script.

I can normally do this with months but this time the format is in DD/MM/YYYY so havent done this before.

Please see attached Qvw.

Thanks for the help!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Are you looking for

Let vTest = AddMonths(Today(),-4);

?

    

CreatedDateDCFFlag
01/10/20151N
01/11/20151N
01/12/20151Y
01/01/20161Y
01/02/20161Y
01/03/20161Y

View solution in original post

3 Replies
swuehl
MVP
MVP

Are you looking for

Let vTest = AddMonths(Today(),-4);

?

    

CreatedDateDCFFlag
01/10/20151N
01/11/20151N
01/12/20151Y
01/01/20161Y
01/02/20161Y
01/03/20161Y
maxgro
MVP
MVP

Let vTest = addmonths(today(1),-4);

1.png

maybe you have to chabge the test from this

If(CreatedDate >= '$(vTest)','Y','N') as Flag,

to

If(CreatedDate >= '$(vTest)','N','Y') as Flag,

Anonymous
Not applicable
Author

Thanks Buddy!