Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
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
Partner

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
Partner

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

khanashique
Creator II
Creator II

Thanks Omar, it worked...