Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi to all i got a problem where my set analysis is not working as expected
this is my set analysis
Sum({<Date1 = {">=$(AddMonths(MonthStart(Max(Date1)),-1))"}>}[Amount])
where if i filter Month = Feb it must give me sum of Jan and Feb
but it only gives me sum of Feb only and i dont know why
this is my inline code
i also include my QVF
Sales:
LOAD Date(Date1) as Date1, Amount INLINE [
Date1,Amount
2018-01-01,100
2018-02-02,200
];
Calendar:
LOAD Date(Date1) as Date1 INLINE [
Date1
2018-01-01
2018-01-02
2018-01-03
2018-01-04
2018-01-05
2018-01-06
2018-01-07
2018-01-08
2018-01-09
2018-01-10
2018-01-11
2018-01-12
2018-01-13
2018-01-14
2018-01-15
2018-01-16
2018-01-17
2018-01-18
2018-01-19
2018-01-20
2018-02-01
2018-02-02
2018-02-03
2018-02-04
2018-02-05
2018-02-06
2018-02-07
2018-02-08
2018-02-09
2018-02-10
2018-02-11
2018-02-12
2018-02-13
2018-02-14
2018-02-15
2018-02-16
2018-02-17
2018-02-18
2018-02-19
2018-02-20
];
Thanks in Advance
Hi,
When you make a selection, your formula also works with the filtered selection.
try
=sum({1<Date1 = {'>=$(AddMonths(MonthStart(Max(Date1)),-1))'}>}Amount)
Regards,
LA
try
Sum({<Date1 = {">=$(AddMonths(MonthStart(Max(Date1)),-1))"}>}[Amount])
Hi,
Try peek() in script.
Peek(Sales,-1)+Sales as prev_Sales
Thanks:
Tushar
still the same mate... btw thanks for the reply...
Hi,
When you make a selection, your formula also works with the filtered selection.
try
=sum({1<Date1 = {'>=$(AddMonths(MonthStart(Max(Date1)),-1))'}>}Amount)
Regards,
LA
no i don't need to do it in the script since i need to be sum dynamically the amount according to its filter..
maybe this:
Sum( {< Date1 = {">=$(=AddMonths(MonthStart(Max(Date1)),-1))"}>} [Amount] )
I hope it helps.
it never work as expected
hmmmm i was wondering where did i go wrong in this formula...
try first replacing the real value as below:
Sum( {< Date1 = {">=2018-01-01"} >} [Amount] )
and also create a text object with the below expression:
=AddMonths(MonthStart(Max(Date1)),-1)
to see what you get.
Hi Andrea
thanks for the reply, actually i already did that
but still no success
Thanks you very much i really appreciate your help..