Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Amen90
Contributor
Contributor

4 Month total Bar chart (Qlik Sense)

Hi everyone,

I hope you are all well! I know this subject has been posted several times and I've read quite a few of the posts, but I'm really struggling to find a solution that works for me! I'm trying to create a bar chart of my data that just shows the 4 month total (latest 4 months) of my data.

I'm trying not to use a global filter on the sheet as I want the graph to be static as it is to be used as a market summary perspective for the just the UK and sales in super markets.

I can currently get my bar chart to show me the 12 month total but reducing it to the 4 months is proving tricky for me!

My bar char only has one dimension, this is:

  • [Apples New vs Old] > this categories my data to apples with are 'new' and 'old'

I am currently working with the following expression within my measures, which limits my chart nicely and displays the year total for sales in the  UK and within supermarkets, but I would like this total to just be the latest 4 months instead:

  • Sum({<Country={"UK"},
    Store type={"supermarket"}>},
    [Projected Data])

I've tried a few different ways to get just the latest 4 month data using my date dimension (called: Date Correct) within my bar chart but non of the expressions work for me, because i'm probably doing a simple thing wrong! My current attempts to show just the 4 month total of my data include:

  • =rangesum(above(Sum({<Country={"UK"},
    Store type={"supermarket"}, [Date correct]>}
    [Projected Data]),0,3))
  • Sum({<Country={"UK"}, Store type={"supermarket"},
    $[Date correct]={">=$(=date(today()-3))"}>}
    [Projected Data])

Any help and guidance would be greatly appreciated.

Kind regards,

Amen

 

 

 

Labels (2)
1 Reply
Yoshidaqlik
Creator II
Creator II

Hi

try it that way, I think it should work,

 

Sum({<
		Country={'UK'}, 
		Store type={'supermarket'},
		[Date correct]={">=$(=MAX(total monthstart([Date correct]),4))"}
	>}
	[Projected Data]
)

 

YoshidaQlik https://www.youtube.com/channel/UC1I9P8MqCZEhB6Nw3FdSqng