Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.


Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

YTD Count of Records

Hi All,

I was trying to get data count based on the following flags (N+R-C) for which I achieved already using the following expression formula for which I created a variable vPremType


= Num( (Count({<T_PREM_TYPE={'N','R'}>}T_PREM_TYPE)-Count({<T_PREM_TYPE={'C'}>}T_PREM_TYPE))/vNumber,'#,##0')

Now I need to get the count based on the YTD of the same period previous year. But I am not getting no data in display as the formula is wrong somewhere which I could not figure. This is how I am caculating the YTD

sum(if(T_APPR_DT <= AddYears(max(total T_APPR_DT), T_YEAR - Year(max(total T_APPR_DT))), $(vPremType))))


1 Reply
Not applicable

Re: YTD Count of Records

I think this will be helpful: LYTD

- Marcus