Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I use only a portion of a dimension's data?

I am trying to put together a chart that displays only two months of data.  I would like the tab I create this chart on to default to this view.  So, my questions is how to I specify data points in an expression.

This doesn't seem to be how to do it, but the way I can write out what I need is as follows:

Sum (([Sales]) When Month = Jul & Aug)

I know that I could select the two months, but my goal is to eliminate navigation errors and have the chart default to a two month selection.

Any ideas?

3 Replies
Clever_Anjos
Employee
Employee

The basic expression is

=sum({<Month={">=$(=date(AddMonths(Max(Month),-1)),'MMM/YYYY') <=$(=date(Max(Month),'MMM/YYY'))"}>}Sales)

Maybe you´ll need to format the dates and change the fieldnames according to your data.

salto
Specialist II
Specialist II

You can set a slection when the document is opened.

Go to Settings -> Document Properties -> Triggers -> On Open

Add Actions: Select in Field Month the values ("Jul"|"Aug")

Hope this helps.

israrkhan
Specialist II
Specialist II

try like below:

=Sum ({1<Month={'>=$(=Max(Month)-1)'}>}Sales)


if u try..


=Sum ({<Month={'July','Aug'}>}Sales),

it will always show the July, Aug, even in december, where the max two month will be Dec, Nov.

try first expression ,