# New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Contributor

## 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
MVP

## Re: Last Quarter

Hi

Try like this

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

4 Replies
MVP

## Re: Last Quarter

Hi

Try like this

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

MVP

## Re: Last Quarter

Try like:

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

Contributor

## Re: Last Quarter

Amazing! Thank you Mayil!!!

Esteemed Contributor

## Re: Last Quarter

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