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: 
fabricius
Contributor II
Contributor II

Using variables in a sum formula

I can not get this formula to work with a variable.

I want to replace the 6 with a variable (manually set month)

Can anyone help me?

Sum({<Month={'<=6'},Year={"$(=Year(Today()))"},[Dept. No]={'820'},Project={'SKAND-820*'}>} Hours)

I have made a variable "vMonth" (see below) but it does not work.

2017-08-10  11.53.33.png

Labels (1)
1 Solution

Accepted Solutions
kaushiknsolanki
MVP
MVP

Try this,

Sum({<Month={'<=$(vMonth)'},Year={"$(=Year(Today()))"},[Dept. No]={'820'},Project={'SKAND-820*'}>} Hours)


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

5 Replies
tresB
Champion III
Champion III

How did you try putting the variable in the expression? Like:

Sum({<Month={'<=$(vMonth)'},... ?


kaushiknsolanki
MVP
MVP

Try this,

Sum({<Month={'<=$(vMonth)'},Year={"$(=Year(Today()))"},[Dept. No]={'820'},Project={'SKAND-820*'}>} Hours)


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
ankur_abhishek
Contributor III
Contributor III

Sum({<Month={'<=$(vMonth)'},Year={$(=Year(Today()))},[Dept. No]={'820'},Project={"SKAND-820*"}>} Hours)

fabricius
Contributor II
Contributor II
Author

Thanks a LOT 😉

fabricius
Contributor II
Contributor II
Author

Works 🙂 Thanks a lot for your help.