Announcements
HI,
I want to apply query range on dimension 2. All possible ways work with dimension[1] but it did not work with dimension[2].
I want to pass dynamic string to dimRange.Value. which will contain two columns on which i will set range. So, while declaring dimRange i declared it for any other column and i mension columnName==[Value] in 'QueryRange.Value'. But for dimension[2] it fails.
I also refered this link: http://www.axaptapedia.com/Talk:Expressions_in_query_ranges
bellow code i am trying out:
dimRange = EmplTable_ds.query().dataSourceTable(tablenum(EmplTable)).addRange(fieldnum(EmplTable, CurrentFacility));
dimRange.value(strFmt('(%1=="%2")',fieldId2Ext(fieldNum(EmplTable, Dimension),2), "PSDU4"));
*This post is locked for comments
I got the answer......
for applying range on two columns out of which one is dimension2
e.g. dimRange.Value(CurrentFacility=='xyz' || dimension2=='PSDU4');
here is the answer:
str range;
;
dimRange = EmplTable_ds.query().dataSourceTable(tablenum(EmplTable)).addRange(fieldnum(EmplTable, CurrentFacility)); // mention any column
range = strfmt (
'( (%1 ==%2) || (%3.%4==%5))'
,'CurrentFacility'
, 'XYZ'
, EmplTable_ds.Name()
, fieldid2name(tablenum(EmplTable), fieldid2ext(fieldnum(EmplTable, Dimension), Dimensions::code2ArrayIdx(SysDimension::Center)))
,'PSDU4'
) ;
dimRange.value(range);
and it's done !!!!!!!!!!!
hey thanks for quick reply. Life is easy because of people like you :)
if i want to set range on only on dimension[2] it works perfect.
what if i want to set range as:
dimRange.value(CurrentFacility=='XYZ' || dimension2 =='PSDU4')
Try doing this instead, should be a bit easier:
dimRange = EmplTable_ds.query().dataSourceTable(tablenum(EmplTable)).addRange(fieldid2Ext(fieldnum(EmplTable, Dimension), 2));
dimRange.value(SysQuery::queryValue("PSDU4"));
Best regards,
-Justin Biggs
André Arnaud de Cal...
294,000
Super User 2025 Season 1
Martin Dráb
232,850
Most Valuable Professional
nmaenpaa
101,158
Moderator