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: 
khanashique
Creator II
Creator II

Set Expression for Date Range

Hi Experts,

Sample data file is attached from where i have to set an expression which will give me total sales of value between days.

Below are the examples which i have set the expressions, but it does not return the value that is expected.

sum({<MONTH= {"$(=getfieldselections(MONTH))"},DAY = {'>=$(vStartDate) <=$(vToday)'}>}SALES)

sum({<MONTH= {"$(=getfieldselections(MONTH))"},DATE = {"$(= '>=' & date(vStartDate) & '<=' & date(vToday))"}>}SALES)

Example: Total current months sales for last year is 77k but i need to see the sales till date for last year (1dec2017 - 18dec2017) which is 48K.

 

Thanks,

MAK.

Labels (3)
1 Solution

Accepted Solutions
OmarBenSalem
Partner - Champion II
Partner - Champion II

Try : 

For MTD of last year

sum({<Year, Month, Date={"<=$(=date(addyears(today(1),-1)))>=$(=date(addyears(monthstart(today(1)),-1)))"}>}Value)

View solution in original post

2 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

Try : 

For MTD of last year

sum({<Year, Month, Date={"<=$(=date(addyears(today(1),-1)))>=$(=date(addyears(monthstart(today(1)),-1)))"}>}Value)

khanashique
Creator II
Creator II
Author

Thanks Omar, it worked...