question

Pinakin K avatar image
0 Likes"
Pinakin K asked Pinakin K commented

Can I put "ORDER BY ASC" or "ORDER BY DESC" conditional?

In my application i want to make the order ascending or descending based on the condition at the pull. is it possible to do than in the Pull From List activity?
FlexSim 20.2.3
flexsim 20.2.3pull from listsql query
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

perhaps you can do it in a previously activity and parse it as $ parameter into a query by a label.

Or you concatenate a string to parse in a query for a custom code.

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Pinakin K, was jason.lightfoot's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
2 Likes"
Jason Lightfoot answered Pinakin K commented

I've done this using a decide activity sending a token to one of two pulls - one that does ASC, the other DESC - which is simple.

If you want it in a single pull activity you could ORDER BY myexpression ASC and have myexpression as an additional field on the list that is some value multiplied by a pullers label value (eg. ascmultiplier) which changes between 1 and -1 depending on whether you want ASC or DESC.

So the expression could be something like this:

value.sortcriterion*puller.ascmultiplier
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Pinakin K avatar image Pinakin K commented ·

@jason.lightfoot

Thanks!

I just returned the Query string in the pull Query as ASC or DSC depending on the condition. It also works.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.