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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis syntax

Hi!

is there anyway to rewrite the following to be included in set analysis

sum (if([Year Week] = year(today()) & Week(today()-7),

Sales)

i have tried the following without success

sum({<([Year Week] = {'=$(year(today()) & Week(today()-7)'>},

Sales)

Best

Brad

1 Solution

Accepted Solutions
tresesco
MVP
MVP

=sum({<([Year Week] = {'=$( =year(today()) & Week(today()-7)'>} Sales)

Note: added '=' sign and removed comma at the end.

Update: Remove the '(' in red.

View solution in original post

2 Replies
tresesco
MVP
MVP

=sum({<([Year Week] = {'=$( =year(today()) & Week(today()-7)'>} Sales)

Note: added '=' sign and removed comma at the end.

Update: Remove the '(' in red.

avinashelite

Hi Bradley,

Please create a variable to store the current year i.e. year(today())

You cannot use & here, use comma which will act as and function.


and use this variable in the set analysis like below:

sum({<([Year Week] = {'=$(variable) , Week(today()-7)'>}Sales)

Regards,

@vi