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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to display the current month's bar in the bar chart first?

Hi everyone,

This is my question, Assume that I have sales data from the month Jan 2013 to Jan 2014 in excel document. Then I am creating a barchart in qlikvew, Now I want to display the the current month's bar first, if this month is feb then Feb's bar should be displayed first. Is this possible to do in qlikview?

Thanks,

Varun Krishna. P

23 Replies
Anonymous
Not applicable
Author

Hi Amanda Caldas,

No, I am getting an error in the Expression Max(MonthYear), What should I choose for the Aggregation field? Max?

Thanks,

Varun Krishna. P

Not applicable
Author

In those cases I use the sort tab to order them with some expression. You can achieve any order you want.

Assuming the MonthYear field is month start displayed in this format, it could be for example:

= avg (if(MonthYear = MonthStart(Today()), MakeDate(1,1,1), MonthYear)

Displayed in ascending order.

Anonymous
Not applicable
Author

Pierre de Calan,

But in my excel sheet , I have two separate fields(columns) for Month and Year. So does MonthYear work inside qlikview? Because I had tried MonthYear  as used by Amanda Caldas but I am getting an error.

So in the sort tab I need to do the following

  • check expression check box
  • then in the text box under the expression I should type that avg(...).

Am I right?



Thanks,

Varun Krishna. P

Not applicable
Author

Hello,

U can set in Sort tab expression as min(Date field) in decending order.

Regards,

Dattaram

tresesco
MVP
MVP

Basically it depends on your date field data type, i.e, if it is really a date or just a text. Would be easy to understand and suggest a solution if you could post a sample qvw.

Anonymous
Not applicable
Author

tresesco

The Date field Data type is a normal text for example I had typed it as 01-01-2014. Ok I'll upload the *.qvw file at the earliest.

Thanks,

Varun Krishna. P

kiranmanoharrode
Creator III
Creator III

Dear Varun,

Take MonthFieldText&'''&Right(YearField) as a calculated Dimension

then check expression in sorting of calculated Dimension and enable numeric sorting in ascending order

and use below expression

=Year&Num(MonthFieldtext,'00')

Regards

Kiran Rode

+91 8976977897

Not applicable
Author

Hi,

If you have two separate fields for Month and Year, try join the two fields in the script:

MonthField&' - '&YearField as MonthYear

Take this MonthYear as dimension.

In Chart Properties:Sort

Check Expression  > Descending

In Expression: MaxString (MonthYear)

sebastiandperei
Specialist
Specialist

If you see that "01-01-2014" is a value of the data field, it isn't a Text field, it is a Dual Date Field (Date type, and string type)

A have a question: If you are showing Sales, and the current month will be the first in ascending order... What sales you will show at the future? If you will show the budget or forecasting sales, your needing is another.

Please, you must send the qvw, and explain a little better your question.

Anonymous
Not applicable
Author

Sebastián Pereira

But I want to display it accordingly to the current month, i.e this month is Jan 2014 so I should display the bar of jan 2014 sales on the first, then if the month becomes Feb 2014  the bar should display the Feb 2014 as the first bar and all the other old bars (2010-2013) should move to the extreme left,

Some thing like this

Jan2010......Jan2014, Feb 2014(this should be the first bar) Mar2014. I have also attached an image, in this image the March bar will be on the first bar and the other months before march is not visible.

And I don't want the total sales for the Jan month, what I want to show is, the individual sales for example Jan 2014 ....

Is my question is clear? But in future what will happen to the old records? say for example jan 2010's records? where will it display? Or how should I display it?