# Qlik Sense App Development

New Contributor III

## Last Year QTD

Hi

I am using the below QTD formula for the Last Financial Quarter. When i filter out for the different quarter it has to show the respective last quarter data. But its not showing right . Logically for the current fiscal quarter i have almost 2 months data so even for the prior QTD it has to take only 2 months like the current FY quarter. But its taking entire last quarter data.

=SUM({< fiscal_quarter, Date ={">=\$(=date(QuarterStart(Today(),-4))) <=\$(=date(QuarterEnd(Today(),-4)))"}>}

accessories_revenue)

Fiscal Quarter Format : FY16'Q1

10 Replies
Valued Contributor

## Re: Last Year QTD

Your expression tells it to take up to the end of the current quarter - 4, not up to today date of last year.

accessories_revenue)

New Contributor III

## Re: Last Year QTD

Hi David,

It's working for the last year QTD. But when i select the other Fiscal Quarter filter Its showing the same result of Last year QTD.

I want this to work dynamically when i select the other fiscal_quarter also.

Can you plz help me achieve that?

New Contributor II

## Re: Last Year QTD

Create a Table with all Quarter and a QuarterID (incremental integer) and than select the possibile quarter dynamicaly, somthing like this:

[QuarterId] = {\$(=concat([QuarterId] - 1, ‘,’))}

New Contributor III

## Re: Last Year QTD

Hi Barbolini

I am looking for something handy ....

For Table creation i have to again go for the data load Due to 50 M data it will take lots of time for me to make the changes.

Can u plz suggest some other option?

New Contributor II

## Re: Last Year QTD

Starting from David exemple

accessories_revenue)

The problem is “Today()” put somthing like “Max([YourDataFiel])” so this is dynamic based on selection, can this solve your problem?

New Contributor III

## Re: Last Year QTD

Yes that helps...Tanq so much

New Contributor III

## Re: Last Year QTD

Hi

This expression is taking YTD  for all the quarter. But the values are not as expected . Is that the problem with the format of the Quarter column FY17'Q4?.

accessories_revenue)

New Contributor III

## Re: Last Year QTD

Hi Guys

I think the expression finding difficult to understand the format of the Quarter.

Can anyone help me to fix this issue asap?