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: 
Bobi
Partner - Contributor II
Partner - Contributor II

Show only current-year in table.

Hi! I have a table with several measures. Like number of orders, average ordervalue and so on.

The dimension is months.

1. Is there any way I can make all columns just summarizing the values for the current year ? (By inserting some conditions for the table, just summarize if year = max(year) or similar.

2. If not, how do I write the set expression to get avg order value for current year. Year dimension is called "booking year".

This set expression works but I need it to only take into account current year;

Sum({$<[Booking ActualDate]={1}>}[Net Sales Amount])/sum({$<[Booking ActualDate]={1}>}counter_Order)

Labels (2)
2 Replies
dplr-rn
Partner - Master III
Partner - Master III

assuming you have a year column add something like below

Year={"$(=Max(Year))"}

jerifortune
Creator III
Creator III

On a Data Load Editor, create a variable

LET vCurrentYear = Year(now(1));

On load script include

Load

Year(OrderDate)     AS OrderYear

.....

 

Then, on your chart expression

You can have something like SUM({<OrderYear={'$(vCurrentYear)'}>}[Sales Amount])