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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable in Set analysis

Hello, guys!

Need your help.

I need to create an expression in straight table summing values from current month till the end of Dec.

I've got a date field in my script named Vacation_Date with format like 'MMM-YY'.

I've created a variable for current month: vCurrentM=Date(Monthstart(Today()),'MMM-YY')

I try an expression like :Sum({<Vacation_Date={">=$(=vCurrentM)<='Dec-15'"},Vacation_Date=>} Days), but it doesnt work correctly, it sums up all the values of the year.

Any ideas on how to get the desired result?

Sample application is attached.

Thnx!

1 Solution

Accepted Solutions
sunny_talwar

Try this expression:

Sum({<Vacation_Date={">=$(=vCurrentM)<='Dec-15'"}>} Days)

View solution in original post

3 Replies
sunny_talwar

Try this expression:

Sum({<Vacation_Date={">=$(=vCurrentM)<='Dec-15'"}>} Days)

MK_QSL
MVP
MVP

Create one more variable

vYearEnd

Date(YearEnd(Today()),'MMM-YY')

Now use this expression

=Sum({<Vacation_Date = {">=$(vCurrentM)<=$(vYearEnd)"}>}Days)

Anonymous
Not applicable
Author

I got it by this way:

goto document properties, tab number

select your field Vacation_Date

define it as date to "MMM-YY" (currently it's mixed)

your table wwas showing correct data immediately