2025 Mar 13 6:13 PM - edited 2025 Mar 23 6:46 AM
I have 6 measure and 1 dimension[staff] in this i want to get top 1 of each measure in single widget. Please explain me how can we done in sac
Regards,
Thayu.
Request clarification before answering.
So without a planning model, yep we're left with using text boxes to give the visual impression of a table.
In this example I only used 3 measures just to see if it works.
This should give you better performance and I'm sure my code/logic can be greatly improved to run more efficiently.
The 'table' on the right is 9 text boxes.
T1,T2,T3 -- T2 is the product, T3 is the value
T4,T5,T6 -- T5 is the product, T6 is the value
T7,T8,T9 -- T8 is the product, T9 is the value
T1,T4,T7 -- I just hardcoded the text in as the values never change
Table_3.rankBy( { relatedDimensions:{[Alias.MeasureDimension]:"M1"},rankOrder:RankOrder.Top,value:1});
var sel = Table_3.getSelections()[0];
var result = Table_3.getDataSource().getResultMember("Product",sel).description;
T2.applyText("Product"+" "+result);
var arr = Table_3.getDataSource().getResultSet();
var value= ConvertUtils.stringToNumber( arr[0][Alias.MeasureDimension].rawValue);
var V2=ConvertUtils.numberToString(value);
{T3.applyText(V2);}
//----------------------------------------------------------------------------
if(T3.getPlainText().length>0)
{
Table_3.rankBy( { relatedDimensions:{[Alias.MeasureDimension]:"M2"},rankOrder:RankOrder.Top,value:1});
sel = Table_3.getSelections()[0];
result = Table_3.getDataSource().getResultMember("Product",sel).description;
T5.applyText("Product"+" "+result);
arr = Table_3.getDataSource().getResultSet();
value= ConvertUtils.stringToNumber( arr[1][Alias.MeasureDimension].rawValue);
V2=ConvertUtils.numberToString(value);
T6.applyText(V2);
}
if(T6.getPlainText().length>0)
{
Table_3.rankBy( { relatedDimensions:{[Alias.MeasureDimension]:"M3"},rankOrder:RankOrder.Top,value:1});
sel = Table_3.getSelections()[0];
result = Table_3.getDataSource().getResultMember("Product",sel).description;
T8.applyText("Product"+" "+result);
arr = Table_3.getDataSource().getResultSet();
value= ConvertUtils.stringToNumber( arr[2][Alias.MeasureDimension].rawValue);
V2=ConvertUtils.numberToString(value);
T9.applyText(V2);
}
Table_3.removeRanking();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @JBARLOW Thank you so much for the solution. Yes its improved the performance but now its taking around 29 sec because i am using 14 text boxes upto 10 text boxes performance was fine. Thank you so much it's a nice thought. please let me know is there anyway to bring under 20 sec.
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.