# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Not applicable

## YTD average ????

Folks,

I'm having an expression named as % Due Eco = count(X)/count(Y) .  From this how can I calculate YTD average of % Due Eco for current year only???

Thanks,

AS

4 Replies
Not applicable

## Re: YTD average ????

Hi Amit,

Try this:

Count({<Date={">=\$(=Num(YearStart(Max(Date))))<=\$(=Max(Date))"}>} X)/Count({<Date={">=\$(=Num(YearStart(Max(Date))))<=\$(=Max(Date))"}>} Y)

Regards

KC

Best Regards,
KC
Not applicable

## Re: YTD average ????

Over here Date is your date field in your application.

Regards

KC

Best Regards,
KC
Not applicable

## Re: YTD average ????

KC you understood it wrong, need to calculate YTD average of the whole expression.

Thanks
AS

Not applicable

## Re: YTD average ????

I guess you mean this:

% Due Eco=Count({<Date={">=\$(=Num(YearStart(Max(Date))))<=\$(=Max(Date))"}>} X)/Count({<Date={">=\$(=Num(YearStart(Max(Date))))<=\$(=Max(Date))"}>} Y)

Best Regards,
KC
Community Browser