Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
how do i calculte sum(kg) , for max month.
exm:
no mather which month i select the callculte will be some kg for the late month & year that i have (=today).
thanks'
yarin.
Hi Yarin,
Assume this example which ha Year,Month, Kg values
LOAD Id,Kg,
Date(Date#(Year,'YYYY'),'YYYY') as Year,
Date(Date#(Month,'M'),'M') as Month;
LOAD * Inline
[
Id,Kg,Year,Month
1,200,2011,5
2,150,2013,4
3,18,2014,5
4,1854,2014,8
5,781,2014,12
];
Then in the front end if want to sum up Kg for current today() month year value then use this expression in any chart or text box
=sum({<Year={'$(=Year(Today()))'},Month={'$(=Num(Month(Today())))'} >} Kg)
Or otherwise if want to sum up data for the max date available in the data then write like
=sum({<Year={'$(=Max(Year))'},Month={'$(=Max(Month))'} >} Kg)
Regards
Anand
you can also try with this one
=sum({<Year={'$(=Max(Year))'},Month={'$(=Max({<Year={'$(=Max(Year))'}>}Month))'} ,Day=,Date= >} Kg)