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: 
Not applicable

QlikSense Default Month Filter

In QlikSense

I am using this expression which gives me last month cumalitive sum.

Aggr(Rangesum(above(TOTAL(SUM ({<Month = {$(=Month( AddMonths(Today(),-1)) )} , [MonthYear] =,  WeekDay=>} [Net Load])), 0, RowNo())), (Year, (NUMERIC)), (Day, (NUMERIC)))

How can I alter this so when someone opens the app it shows the previous month data but when they apply filter for Month, it give the totals for that selected month.

Thanks in advance

1 Solution

Accepted Solutions
Nicole-Smith

What about something like this?

if(GetSelectedCount(Month)=0,

     Aggr(Rangesum(above(TOTAL(SUM ({<Month = {$(=Month( AddMonths(Today(),-1)) )} , [MonthYear] =, 

     WeekDay=>} [Net Load])), 0, RowNo())), (Year, (NUMERIC)), (Day, (NUMERIC))),

     Aggr(Rangesum(above(TOTAL(SUM ({<[MonthYear] =, WeekDay=>} [Net Load])), 0, RowNo())), (Year, (NUMERIC)),

     (Day, (NUMERIC)))

)

It will use the last month calculation when the user doesn't have any month selected, but if they select one or more months, it will use those instead.

If it was in QlikView, I would have two expressions and use GetSelectedCount() calculations as conditions to enable each function when necessary.  As far as I can tell (I don't have experience with QlikSense), you don't have the ability to do the same thing in Sense (please let me know if I'm incorrect here).

View solution in original post

3 Replies
Nicole-Smith

What about something like this?

if(GetSelectedCount(Month)=0,

     Aggr(Rangesum(above(TOTAL(SUM ({<Month = {$(=Month( AddMonths(Today(),-1)) )} , [MonthYear] =, 

     WeekDay=>} [Net Load])), 0, RowNo())), (Year, (NUMERIC)), (Day, (NUMERIC))),

     Aggr(Rangesum(above(TOTAL(SUM ({<[MonthYear] =, WeekDay=>} [Net Load])), 0, RowNo())), (Year, (NUMERIC)),

     (Day, (NUMERIC)))

)

It will use the last month calculation when the user doesn't have any month selected, but if they select one or more months, it will use those instead.

If it was in QlikView, I would have two expressions and use GetSelectedCount() calculations as conditions to enable each function when necessary.  As far as I can tell (I don't have experience with QlikSense), you don't have the ability to do the same thing in Sense (please let me know if I'm incorrect here).

Not applicable
Author

You are AWESOME! Thanks Nicole 🙂

Not applicable
Author

and you are write, there isn't a way to add another expression to the same chart, unless you want to add it as an alternative expression.