Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a parameter (stand-alone) table that I use for filtering a map chart object. The basic structure is
Load Inline [
Parent, Child
Parent 1, Child 1
Parent 1, Child 2
Parent 1, Child 3
Parent 2, Child A
Parent 2, Child B
...
];
I use two list boxes to select the filters, one for Parent and one for Child. The Child list box hides any values that do not apply.
Is there a way to get the Child list box to default select the first applicable Child field value based on the Parent list box selection?
For example, when Parent 1 is selected then Child defaults to Child 1 and when Parent 2 is selected then Child defaults to Child A?
Thank you in advance for your assistance.
-Frank
I'm not sure if this is the best way to do this, but I figured out a workaround...
In the load script, I added a field to the parameter table (Actual field names use this time):
Segment_Parm:
LOAD
RowNo() as pSeg_Temp,
pSegment, // the parent field
pSegment_Text,
pSeg_Detail, // the child field
pSeg_Detail_Text,
...
I then created an indexing table to get the row number for the first occurrence of each parent:
Segment_Index:
NoConcatenate Load
pSegment as pSeg_Parent,
Min(pSeg_Temp) as pSeg_Child
Resident Segment_Parm
Group by pSegment;
Then, I set the default field value to:
=FieldValue('pSeg_Detail_Text',FieldValue('pSeg_Child',FieldIndex('pSeg_Parent',Only(pSegment))))
If there's a more eloquent way to do this, I'm happy for any guidance you can provide. This feels more like a workaround than a success at this point, but it got me where I wanted to go.
I'm not sure if this is the best way to do this, but I figured out a workaround...
In the load script, I added a field to the parameter table (Actual field names use this time):
Segment_Parm:
LOAD
RowNo() as pSeg_Temp,
pSegment, // the parent field
pSegment_Text,
pSeg_Detail, // the child field
pSeg_Detail_Text,
...
I then created an indexing table to get the row number for the first occurrence of each parent:
Segment_Index:
NoConcatenate Load
pSegment as pSeg_Parent,
Min(pSeg_Temp) as pSeg_Child
Resident Segment_Parm
Group by pSegment;
Then, I set the default field value to:
=FieldValue('pSeg_Detail_Text',FieldValue('pSeg_Child',FieldIndex('pSeg_Parent',Only(pSegment))))
If there's a more eloquent way to do this, I'm happy for any guidance you can provide. This feels more like a workaround than a success at this point, but it got me where I wanted to go.
Lacking any responses, I'll call this a correct answer