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

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

Negative Values In Set Analysis

Is there a way that negative numbers need to be expressed in Set Analysis? I have the following statement that works without issue. Date Diff is a field that determines how many weeks there are between the current week and the week that either (A) actual hours were logged or, (B) week that the hours are forecast to be logged. So, the number will positive for Actual Hours, and negative for Forecast Hours.

This works fine in figuring actual hours for the last four weeks (including the current week):

SUM( {$<[Week Ending Dt]=, [Date Diff] = {0,7,14,21} >} [Act Hours] )

This statement fails as soon as I put in the negative number indicator for four weeks in the future ('error in set modifier ad hoc element list'):

SUM( {$<[Week Ending Dt]=, [Date Diff] = {-7,-14,-21,-28} >} [Fore Hours] )

I know there are other ways of attacking it, but is there any way to get this to work?

1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

Jeff,

Try enclosing each number with single quotes.

Regards,

View solution in original post

2 Replies
vgutkovsky
Master II
Master II

Jeff,

Try enclosing each number with single quotes.

Regards,

Not applicable
Author

That did it - thanks as always Vlad!