Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
we need to check month & year, we use this function "sum({<YEAR={'2014'},Month={'APR'}>}HWB_WT/1000)+sum({<YEAR={'2014'},Month={'APR'}>}VOLUME_IN_TEUS)" but the result showing zero. kindly advice me,how to use this function.
Thanks
Can you post example QVW. Thanks
Verify Month column month format matches with your value('APR')
Try with this
=(sum({<YearField={'2014'},Month={'APR'}>} HWB_WT) / 1000) +
sum({<YearField={'2014'},Month={'APR'}>}VOLUME_IN_TEUS)
Or
=sum({<YearField={'2014'},Month={'APR'}>} (HWB_WT / 1000 ) ) +
sum({<YearField={'2014'},Month={'APR'}>}VOLUME_IN_TEUS)
Or may be check the Month values it is APR or Apr cross check.
HI
Thanks for your support. we will try same .
Hi,
Check this
sum({<YEAR={'2014'},Month={'Apr'}>}HWB_WT/1000)+sum({<YEAR={'2014'},Month={'Apr'}>}VOLUME_IN_TEUS)
Or
sum({<YEAR={'2014'},Month={4}>}HWB_WT/1000)+sum({<YEAR={'2014'},Month={4}>}VOLUME_IN_TEUS)
If not working, then post the sample? what is the format of month in your data model, is APR or Apr or 4. Is YEAR and Month fields exists in your datamodel?
Regards,
Jagan.
Hey.
It is *much* better to do this calculation in ONE {set} instead of two sets.
Calculation time will be significantly lower.
Like this:
sum({<YEAR={'2014'},Month={'APR'}>}HWB_WT/1000+VOLUME_IN_TEUS)
If possible, always try and make as few sets as possible.
Hi
I agree, but with one modification:
sum({<YEAR={'2014'},Month={'APR'}>} RangeSum(HWB_WT/1000, VOLUME_IN_TEUS))
... to ensure that the result is still correct if one of the values is null. If your system guarrantees that there are no nulls in either of these two fields, then the RangeSum() is not required.
HTH
Jonathan
Yes.
And if we are optimizing, why not make a YearMonth field and issue ONE selection instead of two:
sum({<YEARMONTH={201404}>} RangeSum(HWB_WT/1000, VOLUME_IN_TEUS))
Also, notice that YEARMONTH is selected by its integer value rather than it's casted string equivalent.
If you got correct then close the thread as Correct or helpful for references.
Thanks & Regards