Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Naushad07
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
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

7 Replies
Anil_Babu_Samineni

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

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Shubham_Deshmukh
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)

 
Naushad07
Contributor III
Contributor III
Author

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

Vegar
MVP
MVP

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.

Naushad07
Contributor III
Contributor III
Author

I am using Month in X axis, Not Date. I am displaying Bar chart month over month
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!