Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
drcater1413
New Contributor II

If Statement with AutoCalendar field

I am trying to show both year and month with the following statement:

if(year([first_paymnt_date.autoCalendar.YearMonth])<=2014,'',year([first_paymnt_date.autoCalendar.YearMonth]))

Any suggestions of how to combine year and moth?

Thanks

7 Replies

Re: If Statement with AutoCalendar field

I believe this field [first_paymnt_date.autoCalendar.YearMonth] is your date field then take Year, Month from this field like


Year([first_paymnt_date.autoCalendar.YearMonth])

Month([first_paymnt_date.autoCalendar.YearMonth])

=if(year([first_paymnt_date.autoCalendar.YearMonth]) <= 2014,'',year([first_paymnt_date.autoCalendar.YearMonth]) &Month([first_paymnt_date.autoCalendar.YearMonth]))


drcater1413
New Contributor II

Re: If Statement with AutoCalendar field

Great code, but one problem.  At the beginning of my series I have out of phase calculation.  I have filter by year and for every year the line graph starts at an unusual peak.  Not sure there is some additive function in the calculation.  I read somewhere that the autoCalendar is a little buggy.  I am attaching the pic.Capture.PNG

Re: If Statement with AutoCalendar field

I didn't here about the autoCalendar there might be Master calendar though.

Re: If Statement with AutoCalendar field

One more way is

=if(year([first_paymnt_date.autoCalendar.YearMonth]) <= 2014,'',year([first_paymnt_date.autoCalendar.YearMonth]) &'-'&Month([first_paymnt_date.autoCalendar.YearMonth]))

drcater1413
New Contributor II

Re: If Statement with AutoCalendar field

Thanks,  I found my error in my measure it was counting the Nulls and blanks.

Re: If Statement with AutoCalendar field

Good One

Re: If Statement with AutoCalendar field

You can close the thread now with appropriate answers.