Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
WHat is the FirstSortedValue() ?? Can anyone explain with example ??
Thanks
hi
firstsortedvalue([{set_expression}][ distinct ] [ total [<fld {, fld}>]] expression [, sort_weight [, n]])
returns the first value of expression sorted by corresponding sort-weight when expression is iterated over the chart dimension(s). Sort-weight should return a numeric value where the lowest value will render the corresponding value of expression to be sorted first. By preceding the sort-value expression with a minus sign, the function will return the last value instead. If more than one value of expression share the same lowest sort-order, the function will return null. By stating an n larger than 1, you will get the nth value in order.
Examples:
firstsortedvalue ( PurchasedArticle, OrderDate )
firstsortedvalue ( PurchasedArticle, -OrderDate, 2 )
firstsortedvalue ( A/B, X*Y/3 )
firstsortedvalue ( distinct PurchasedArticle, OrderDate )
firstsortedvalue ( total PurchasedArticle, OrderDate )
firstsortedvalue ( total <Grp> PurchasedArticle, OrderDate )
it will give the first value of expression based on the sort wait .sort wait should be numeric
ex:
table1:
A
B
C
D
table2:
1
2
3
4
if u write the expression firstsortedvalue(table1,table2) output is D i.e is 4
if u go for firstsortedvalue(table1,-table2) then lowest value A i.e is 1
HEy,
If i use
firstsortedvalue ( PurchasedArticle, OrderDate ) |
then does it return PurchasedArticle value on basis of Minimum OrderDate ??
And if i use firstsortedvalue ( PurchasedArticle, -OrderDate )
then does it return PurchasedArticle value on basis of Maximum OrderDate ??
Is it so ??
if u use - symbol then it gives minimum value
if u have no symbol then it gives maximum value
firstsortedvalue(ValueField, WeightField)
It will give you the first sorted value of the ValueField depending on the specified WeightField.
eg. firstsortedvalue(AccountBalance,ReportDate)
This will return the value of AccountBalance on the first date as per the date variable.
Hope this helps
Hey,
firstsortedvalue(AccountBalance,ReportDate)
will return AccountBalance corresponding to Maximum Report Date ??
no, it will return for minimum report date, if you want it to return for maximum report date then you can edit the expression as firstsortedvalue(AccountBalance,-ReportDate)
and the variable for weight may not necessarily be a date variable, you can use any other variable also.