Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How do I get the current MonthYear on a chart?

I attended the Qlikview developer training last week and have been having a play with the file we created. However I am having trouble trying to get the current MonthYear on a chart.

We added the master calendar at the training so the script should be ok.

I can get it to work for just the year, so if I use the expression:

sum({$<Year = {$(=max(Year))}>}LineSalesAmount)

it works fine.

However if I use the expression:

sum({$<MonthYear = {$(=max(MonthYear))}>}LineSalesAmount)

then the chart goes blank.

What am I doing wrong?

1 Solution

Accepted Solutions
giakoum
Honored Contributor II

Re: How do I get the current MonthYear on a chart?

It does return values. See attached, green column in chart

7 Replies
Not applicable

Re: How do I get the current MonthYear on a chart?

Hi

Send me the Sample Application

Not applicable

Re: How do I get the current MonthYear on a chart?

Here it is, it's the same one they use at the training.

Not applicable

Re: How do I get the current MonthYear on a chart?

Anybody?

I would have thought this would be quite simple.

giakoum
Honored Contributor II

Re: How do I get the current MonthYear on a chart?

Year is a number, MonthYear is not.

So you need to use single quotes to make it work :

sum({$<MonthYear = {'$(=max(MonthYear))'}>}LineSalesAmount)

Double qoutes also work as QlikView consideres it as a search.

Not applicable

Re: How do I get the current MonthYear on a chart?

Thank you for responding Ioannis.

However, the expression you gave still returns a blank and if I use double quotes instead it also returns a blank.

giakoum
Honored Contributor II

Re: How do I get the current MonthYear on a chart?

It does return values. See attached, green column in chart

Not applicable

Re: How do I get the current MonthYear on a chart?

Sorry Ioannis, not sure what I did to make it not work but can see it does now.

Thanks a lot for your help