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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
picturebox
Partner - Creator
Partner - Creator

Simple Function inside Set Analysis

Hello all,

using this code will return the correct values, i.e. vRollWeek1 and vRollWeek2 are correctly interpreted.



sum({$ < WeekIndex = {"> $(vRollWeek1) <= $(vRollWeek2)"} , CW= , SalesMonth= , SalesQuarter=>} UnitMovement )



If I want to increase the vRollWeek1 by some integer, say 1, I thought I could use the syntax:



sum({$ < WeekIndex = {"> $(vRollWeek1)+1 <= $(vRollWeek2)"} , CW= , SalesMonth= , SalesQuarter=>} UnitMovement )


But this syntax does not work. I think it evaluates the first expression to 1. I have tried brackets, inverted commas (double and single..) but I cannot make it work without setting a variable for vRollWeek1+1 and inserting that variable - then it works. This is a bit of a bind though as I get a large number of variables. Can anyone help?

Thanks,

Petra

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Petra

Try this:

sum({$ < WeekIndex = {"> $(=vRollWeek1+1) <= $(vRollWeek2)"} , CW= , SalesMonth= , SalesQuarter=>} UnitMovement )

I think that will work.

Jonathan


					
				
			
			
				
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Petra

Try this:

sum({$ < WeekIndex = {"> $(=vRollWeek1+1) <= $(vRollWeek2)"} , CW= , SalesMonth= , SalesQuarter=>} UnitMovement )

I think that will work.

Jonathan


					
				
			
			
				
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
picturebox
Partner - Creator
Partner - Creator
Author

Thanks Jonathan,

of course it does! Skipped my brain - it must be Monday.

Best Regards,

Petra

Miguel_Angel_Baeyens

Hello Petra,

Did you try?

WeekIndex = {">$(=$(vRollWeek1) +1)<= $(vRollWeek2)"}


Hope this helps