cancel
Showing results for 
Search instead for 
Did you mean: 

SortByKey function error in queues

Former Member
0 Kudos

Hi All!

I have a question about this function, the problem is that you can only apply this function when both queues are equal (same length)

I'm aware of that and for those cases i'm trying to do an "IF-S" to control that if the queues are not equal the Sort doesn't execute, but no matter what condition i try it seems like the java functions is trying to compile anyway, so i can't avoid that error

For example I'm sorting 2 values but sometimes for 3 values of a material only comes 2 descriptions on the other quote , (and that field is 0.1) so.. i'm not sure what to do for those cases since i would need to create 3 segments where the last one doesn' t have any value to map, and instead of that i'm getting an exception since the queues are not equal

- Does anyone knows how to fill contexts with blanks to do a correct SortBykey?

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor

Hi,

Use the node function mapWithDefault so that suppressed values are automatically treated as a blank.

Hope this helps,

Answers (2)

Answers (2)

Former Member

The best solution is as suggested above to use standard function MapWithDefault.

Do your mapping something like this....

Source -> MapWithDefault -


> RemoveContext---> Sort -


> Target.

Regards,

Sarvesh

Former Member
0 Kudos

Hi, Alexis Alanis

What Mark suggested should solve your problem, it is simplest way.

Or since the occurence is 0:i, you can also use "exist" followed by if-else-than block.

Regards.

Liang