Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Last Quarter

Hi all,

I'm trying to count how many units were sold last quarter. For this quarter I can do the below and it gives the correct figures.

sum({<UNIT.SOLD_DATE = {">=$(=date(quarterstart(today())))  <=$(=date(quarterend(today())))"}, >} UNIT.TOTALSOLD)

In my head I should be able to do the following,

sum({<UNIT.SOLD_DATE = {">=$(=date(quarterstart(today())))-1  <=$(=date(quarterend(today())))-1"}, >} UNIT.TOTALSOLD)


But this doesn't work, has anyone got any ideas as it seems quite simple?


Thanks


Gareth

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

sum({<UNIT.SOLD_DATE = {">=$(=date(quarterstart(today(),-1)))  <=$(=date(quarterend(today(),-1)))"}, >} UNIT.TOTALSOLD)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi

Try like this

sum({<UNIT.SOLD_DATE = {">=$(=date(quarterstart(today(),-1)))  <=$(=date(quarterend(today(),-1)))"}, >} UNIT.TOTALSOLD)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP

Try like:

sum({<UNIT.SOLD_DATE = {">=$(=date(quarterstart(today(),-1)))  <=$(=date(quarterend(today(),-1)))"}, >} UNIT.TOTALSOLD)

Anonymous
Not applicable
Author

Amazing! Thank you Mayil!!!

Anonymous
Not applicable
Author

Remove Comma in last, try this:


sum({<UNIT.SOLD_DATE = {'>=$(=date(quarterstart(today())))-1  <=$(=date(quarterend(today())))-1'} >} UNIT.TOTALSOLD)


Also make sure UNIT.SOLD_DATE, have same format as Today(), if format of both the date mismatch, it wud not give you anything