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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
v_nicolino
Contributor
Contributor

problem with expression

Hi all,

i have a problem with this expression

 

sum({$<DO11_DATADOC1 = {">=$(vInizioData1)<=$(vFineData1)"}> + $<DO11_DATADOC1 = {">=MakeWeekDate(Year(Addyears(date('$(vInizioData1)'), -1)), week(Date('$(vInizioData1)')), Num(weekday(date('$(vInizioData1)')))) )<=MakeWeekDate(Year(Addyears(date('$(vFineData1)'), -1)), week(Date('$(vFineData1)')), Num(weekday(date('$(vFineData1'))))) "}>} DO30_QTA1/6)

 

 it doesn't give me an error, but it doesn't give me a result. surely I have something wrong in the syntax, but I don't understand what.

 

thanks

1 Reply
GaryGiles
Specialist
Specialist

It's a little difficult to figure out the issue without knowing the contents of your variables.  One thing that I do see is that you need to wrap your functions within set analysis with $(=function()) to get it to calculate properly.

sum({$<DO11_DATADOC1 = {">=$(vInizioData1)<=$(vFineData1)"}> + $<DO11_DATADOC1 = {">=$(=MakeWeekDate(Year(Addyears(date('$(vInizioData1)'), -1)), week(Date('$(vInizioData1)')), Num(weekday(date('$(vInizioData1)'))))) )<=$(=MakeWeekDate(Year(Addyears(date('$(vFineData1)'), -1)), week(Date('$(vFineData1)')), Num(weekday(date('$(vFineData1')))))) "}>} DO30_QTA1/6)

One thing that you can do when trying to figure out what is wrong with a set analysis function is to look at the bottom of the Expression editor.  Below, the "OK", Qlik will display how it is interpretting the expression.  A screenshot of this would be more useful to diagnosing the issue.