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

Excluding current month in chart


Hi,

I want to exclude the current month in a graph, but keep all the data in the load.

My calcualtion in the graph is:

=sum( {$<Metric_Code={'RTT18'}>} Metric_Value)

I tried to use this calcualtion to exclude the current month but it hasnt made any difference. May is still showng the the graph:

sum({$<Metric_Code={'RTT18'}>} if (MonthYear <> monthname(today()),  Metric_Value))

Can anyone help?

7 Replies
PrashantSangle

Hi,

try like

sum( {$<Metric_Code={'RTT18'},MonthYear={"<$(=MonthName(Monthstart(Today())))"}>} Metric_Value)

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

This just makes the line on my graph completely disappear (?)

Not applicable
Author

Hi Kate,

I guess Month is one of your dimension.

So either use Dimension limits (according to your chart) or edit calculated dimension and state an IF(Month < $(vCurrrentMonth), Month)

vCurrentMonth must be defined. To make a test you can hard code first

best regards

Chris

santhoo_san
Partner - Creator II
Partner - Creator II

you can try this

sum({$<Metric_Code={'RTT18'},MonthYear - ={"$(=MonthName(Monthstart(Today())))"}>} Metric_Value)

PrashantSangle

Hi,

Can you post sample apps???

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
danieloberbilli
Specialist II
Specialist II

Please find .QVW attached

mohammadkhatimi
Partner - Specialist
Partner - Specialist

Hie...

Use function Exclude

Read below script

Indirect Set Analysis

p( ) = Possible

e( ) = Excluded

Excluded

Possible

Customer = p({<Year={$(=max(Year)-1)}>} Customer)

Returns customers who had an association to last year.

sum(({<Year={$(=max(Year))},

Customer = p({<Year={$(=max(Year)-1)} Customer>}) Sales)

Returns this year’s sales for customers who had sales last year

Indirect Set Analysis

sum({$<CompanyName = p({$<CategoryName={'Baby Clothes'}>}

CompanyName)>} Sales)

Sales for Customers who purchased Baby Clothes.

The set p({}) returns the values of CompanyName (Customer) that

purchased Baby Clothes.

sum({$<CompanyName = p({$<CategoryName={'Baby Clothes'}>}

CompanyName) - p({$<CategoryName={'SportsWear'}>}

CompanyName)>} Sales)

Sales for Customers who purchased Baby Clothes but not

  1. Sportswear.The first set p({}) returns CompanyName that purchased

Baby Clothes.The second set p({}) returns CompanyName that

Purchased SportsWear.The Unary Operator "-" between the two gives

a list of Customers (Company Name)that belong to the first but not the

other set



Hope this helps you.


Regards,


Mohammad