Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Week Sales Calculation Issue

I've got a really strange issue calculating previous week sales. I've gone through these here forums, tried all relate examples, and nothing. Oddly enough, i can calculate previous year sales no problem. I'm remembering to exclude the year and such in my set analysis. Below is my code, and i'm wondering if anyone sees anything glaringly wrong that i may have missed...

SUM(
{$<
[Week Date] = {$( =DATE(ONLY([Week Date])-7) )},
Year =,
Month =,
Quarter =
>}
[Qty Sold])


Thanks for any advice/help,

1 Solution

Accepted Solutions
Not applicable
Author

I solved this one.... forgot that Qlikview in SR3 and 4 interprets a date as a number in set analysis... so my solution was to convert the date to a number in the script, then use the new field in the set analysis.

Thanks for the info on the nulls though!

-Scott

View solution in original post

2 Replies
Not applicable
Author

If you have many [Week Date] for current selection, the only() function will return NULL.

Not applicable
Author

I solved this one.... forgot that Qlikview in SR3 and 4 interprets a date as a number in set analysis... so my solution was to convert the date to a number in the script, then use the new field in the set analysis.

Thanks for the info on the nulls though!

-Scott