BAQ Sorting Options

Hello!

I am trying to get my BAQ data to sort based off our Plant Locations. Each location is assigned a number and am wanting the plant names listed in the numeric order.
Can someone help?

Thank you!

There is a sort in the BAQ editor. Did you find that?

3 Likes

Look at the display fields, there’s a sort there.

There is a sort order but it is only showing by Ascending or Descending. I want it to go in order of our plant names based on our assigned plant numbers if that makes sense.

You’ll have to include those fields in your BAQ, then sort by them.

2 Likes

I have them in a column but how do I get it to sort in the order I want:
i.e I don’t want: Apples, Bananas, Coconut, Dragon Fruit;
I want: Coconut, Apples, Bananas, Dragon Fruit.

Does that make sense?

You’re gonna have to show us what you’re doing.

you have
Apples:2, Bananas:3, Coconut:1, Dragon Fruit:4;
I want:
Coconut:1, Apples:2, Bananas:3, Dragon Fruit:4.

See, I have another field in there with what I want to sort by. Do you have the field in your query? (I don’t know if you do or not unless you show it to me)

Here the sort screen. You can use any field from any table that is in your BAQ on the top level.
image

1 Like

I have my locations listed and in the sort order but they are showing in Descending order.

I want them to show in the order of HQ, MIN, KEN, WBN, MID, TIP, AND, TAL, PER, VON, WDH, BGN, JEF, CAN

image

NT_CIPRec.baq (17.0 KB)

Where is that order referenced? Are you just making that up cause you know it? Or is that stored somewhere in the database?

It is not stored anywhere in the database. I am wanting to get it in somehow and sort on it.

You’re quickest/easiest path is to make a calculated field.

case when site = 'mysite' then 1
when site = 'OtherSite' then 2
etc.
end

Then sort by that field.

That will only be in this specific BAQ then. Other options are use use UD codes, or add a UD field to the plant table to store that number to be able to sort by. It depends on how many places you are gonna use this sort.

2 Likes

Ahh - Yes!! I was entering my calculated formula in incorrectly!!! Thank you!!!

1 Like

Calculated field might be good for just one BAQ but if it’s something you might need elsewhere, a UD field’s probably a good bet.

Other options - use “Plant 001”, “Plant 002”, etc. as a prefix in Plant.Name or Plant.CommentText (and then include that field as your sort).

Or don’t follow best practices and just dump it in Plant.FaxNum :laughing:

1 Like

You could define a calculated field and assign it a number based on the plant and then sort on that field.

Is the plant ID a number? Is there a UD field on the Plant table? How did you assign a number to a plant?

Joe

Yes! I did something equally brilliant/stupid.

People care if an order is flagged as “next day air” and want to prioritize orders as such.

OK, cool, but there’s no setting for that. So I ranked my Ship Vias with this unused WebShipVia field. It’s built in but it is not even normally visible, and in Kinetic I think I had to create an edit field for new ones.

However, yes, as a rule, the fields you think are not used and are harmless, one day you will find they are neither.

1 Like

Truth. I was just being a smarta$$ about the FaxNum field.

1 Like