Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Bobi
Partner - Contributor II
Partner - Contributor II

Show only current months dates in table.

Hi. I have one table with dates and then one column with net sales amount MTD. I use this expression which gives values from 1 october to 8 of october. Sum({$<$(vL.MTD)>}[Net Sales Amount]) However I still got a lots of other dates showing up so i need to filter on month and year in a filterpane to see the values I´m interested in. I have tried with different set expressions, sorting and so on to only show the dates for current month, but without success. Anyone having a suggestion? The Vl.MTD variable looks like: [Booking InMTD]={1},[Booking YearsAgo]={$(=min("Booking YearsAgo"))} Would try to stay away from flags if possible, risk to slow down the app?
3 Replies
Vegar
MVP
MVP

Try

Sum({<DateField={">=$(=Num(MonthStart(Today())))<=$(=Num(Today()))"}>} [Net Sales Amount])

Bobi
Partner - Contributor II
Partner - Contributor II
Author

Hi Vegar. Thank you, didn´t work unfortunately. I have also tried the expression:

 

Sum({$<$(vL.MTD)>}[Net Sales Amount])

 

Where the variable vL.MTD is:     [Booking InMTD]={1},[Booking YearsAgo]={$(=min("Booking YearsAgo"))}

What it shows right now is 1-10 but for every month in 2019.

So 1-10 jan 2019, 1-10 feb 2019, 1-10 mar 2019... 1-10 october 2019.

How do I change to only make it show 1-10 october 2019?

 

puneetagarwal
Partner - Creator II
Partner - Creator II

Hi Bobi,

You can create a variable and which returns the data for current month something like this "Month(max(MonthField))"

and use that variable in your expression where to want to show data only for current month something like this

=if(GetSelectedCount(MonthField)=0,sum({$<MonthField={"$(vCurrentMonth)"}>}Sales),
sum(Sales))

Change the expression accordingly.

Regards,
Puneet Agarawal