Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to calculate the variance of YTD as i have YTD(Current year) and YTD(Previous Year)
Variance:
sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>
-
<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)
Variance Percentage:
sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>
-
<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)
/
Fabs(Sum({<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty))
Hi,
we have current year data we can cal it as YTD,previous year data we can cal it as a PYTD
Plz find the master calender link you vl get more information.
I Want to find variance that is GAP for Current and previous year YTD
You can calculate as
(YTD- PYTD)/ PYTD
Can we do it for Sum(sales)
i found YTD by using YTD==sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)
LY YTD==sum({<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)
now how can i calculate Variance
(sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty) - sum({<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty ) /
sum({<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty )
Variance:
sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>
-
<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)
Variance Percentage:
sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>
-
<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)
/
Fabs(Sum({<Year={$(=Max(Year)-1)},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty))
As you can see the expression above contain differential analysis in the same Sum function.
That syntax is clean and powerful.
Its is not working but thanks man
Can you post some sample data?