Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Meg00
Contributor III
Contributor III

How to only show current week (and year)

I have a small problem

I have a textbox in wich I want to show number of calls this week, now it looks like this (Flagga_Kontakt, represent number of incoming calls):

=sum({<Week={$(#=week(today()))}>} Flagga_Kontakt)

The problem here is that it shows the sum of calls from both this week 2013 and same week the past years. Any suggestions?

1 Solution

Accepted Solutions
Not applicable

try this

sum({<year={$(=year(today()))}, Week={$(=week(today()))}>} Flagga_Kontakt)

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

you need a field "year"

=sum({<Week={$(#=week(today()))=}>} Flagga_Kontakt)

to add the condition in set analysis year={$(=year(today()))}

hope it helps

Not applicable

=sum({$<Week={$(vThisWeek)}, Year={$(vThisYear)}>} Flagga_Kontakt)

Put into your variables :

LET vDateToday = num(Date(Today(), 'YYYY-MM-DD'))

or you could just say

Let vThisYear = num(Year(Today())

Let vDateToday = num(Today())

LET vThisWeektext = Week(vDateToday);

Remember if you use variaables with dates and not NUM infront, you need to put ' ' before your variables in your expression

Not applicable

=sum({<Week={$(=week(today()))}>} Flagga_Kontakt)

or

sum({<year={$(=year(today()))}, Week={$(=week(today()))}>} Flagga_Kontakt)

Meg00
Contributor III
Contributor III
Author

This shows the exact same numbers as before. It still shows totals of all years.

Not applicable

try this

sum({<year={$(=year(today()))}, Week={$(=week(today()))}>} Flagga_Kontakt)

Meg00
Contributor III
Contributor III
Author

Thank you, that worked just fine!