Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
User0
Contributor III
Contributor III

How to remove space from bar graph where there is no value

HI,
I have a bar chart where I have Year as a dimension. However, for the required measure, there are missing values for a lot of Years and hence it is coming as blank. I want to remove these years from my bar graph. 
please find image for reference .
I just want to keep 2020-2022 .

User0_0-1656394899133.png

 

Labels (5)
3 Solutions

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@User0  Try using the Set expression like below: Let me know if this worked.

Sum({<Year={'2020','2021','2022'}>}LineSalesAmount)

View solution in original post

sidhiq91
Specialist II
Specialist II

@User0  or to make it more dynamic, you can use the below expression:

Sum({<Year={">=$(=Max(Year)-2)<=$(=Max(Year))"}>}LineSalesAmount)

View solution in original post

User0
Contributor III
Contributor III
Author

User0_0-1656409963724.png

I found another solution ,

We can go to chart properties -> Add ons -> uncheck 'include null values'

 

View solution in original post

4 Replies
sidhiq91
Specialist II
Specialist II

@User0  Try using the Set expression like below: Let me know if this worked.

Sum({<Year={'2020','2021','2022'}>}LineSalesAmount)

sidhiq91
Specialist II
Specialist II

@User0  or to make it more dynamic, you can use the below expression:

Sum({<Year={">=$(=Max(Year)-2)<=$(=Max(Year))"}>}LineSalesAmount)

User0
Contributor III
Contributor III
Author

thank you @sidhiq91 

User0
Contributor III
Contributor III
Author

User0_0-1656409963724.png

I found another solution ,

We can go to chart properties -> Add ons -> uncheck 'include null values'