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

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

pinakin_k
Not applicable
14 Views
4 Replies
Message 1 of 5

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

pinakin_k
Not applicable

[ FlexSim 20.2.3 ]

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?
0 Likes
Accepted solutions (1)
15 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor

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
Message 3 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

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
Message 4 of 5

Ben_WilsonADSK
Community Manager
Community Manager

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
Message 5 of 5

pinakin_k
Not applicable

@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