Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

How do I restrict data till current month in Bar chart?

Hi All,

I have a requirement where I have to display the bar chart till only the current month. Need help on how to achieve this functionality?.

Details:

I have Data from 2016 till 2020. But I want to restrict my bar chart to display till current month. 

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Hi,

you should use the set analysis for that.

Below is the example.

 

Sum({<Date = {"<=$(=Monthend(today()))"}>}Sales)

 

For more information on Set analysis, find below link.

https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/ChartFunctio...

 

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

7 Replies
Highlighted

My preference would be, create Month field with integer and use formula like

Sum({<MonthNum = {"$('<=' & =Max(MonthNum))"}, Year={"$('<=' & =Max(Year))"}>} Sales)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
MVP & Luminary
MVP & Luminary

Hi,

you should use the set analysis for that.

Below is the example.

 

Sum({<Date = {"<=$(=Monthend(today()))"}>}Sales)

 

For more information on Set analysis, find below link.

https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/ChartFunctio...

 

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

Highlighted
Specialist
Specialist

Hi @Naushad07 ,

You can restrict it using calculated dimension, edit your dimension like below (keep date format as per yours) : 

=if(date(yourDateField,'dd/mm/yyyy')<date(MonthEnd(today()),'dd/mm/yyyy'),yourDateField)

OR use exp like this

=Sum({<yourDateField= {"<=$(=MonthEnd(today()))"}>}yourQuantity)

 
Highlighted
Contributor III
Contributor III

My current Expression is 

Count({<SetAnalysis={'Condition1'}>}Distinct Projects)

I am taking Month in X axis..

I have tried the expression that you have suggested..looks like it doesn't work

Highlighted
Partner
Partner

Lets assume that your current expression is SUM(Amount) and that you got an
numeric YearMonth field that increase numerically by every month. E.g.
201901, 201902 OR created by monthName() function. Then you can do the
following.


Adjust your expression with set analysis.

Sum( {< YearMonth={"$(=max(YearMonth))"} >} Amount)

This expressive will calculate the amount for the latest yearmonth in your
selection/data.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Contributor III
Contributor III

I am using Month in X axis, Not Date. I am displaying Bar chart month over month
Highlighted
MVP & Luminary
MVP & Luminary

It doesnt matter, your X axis could be month, but the Date filter used in set analysis, will filter month by default.

Try the given expression and you will see the difference.

 

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".