
1. Re: Sorting with parameters
Aaron Clancy May 29, 2014 1:45 PM (in response to luciana.suran)In your scenario, aren't they the same order? FYI you can't sort table calcs with the native sort so you have to get tricky with it.

Sample_F_3.twbx 91.2 KB


2. Re: Sorting with parameters
luciana.suran May 29, 2014 1:51 PM (in response to Aaron Clancy)Thanks! I had previously added the calculated field "SortCF" to the Columns shelf but had my 2 columns in the opposite order. So the order of the columns makes a difference with the sorting ability?
In this case the 2 measures are the same but this is just a tiny subset of the dataset I am wrangling with.
So there is no way to sort when using table calculations?

3. Re: Sorting with parameters
Aaron Clancy May 29, 2014 2:01 PM (in response to luciana.suran)Well......"yes" there is a way to sort it. You just have to do it by placing it on the rows or columns and hiding the header. It's a trick. You could add another parameter called "direction" with values of ascending or descending and use that to determine whether you multiply the values by 1 or not. So essentially it does the same thing as a sort but it's just a different user experience.
And to answer your question, the sort is based on the dimensions from left to right on the columns shelf. If you have "discrete" values of your calc on the far left this will force it in to the header and those values will automatically sort ascending. The trick is to multiply those resulting discrete values by negative 1 if you want to see them descending.
And you already figured out to use the parameter to control which measure populates the SortCF calc.
If they weren't table calcs you could have just sorted the dimension you have on columns by that calculation.

Sample_F_3.twbx 91.1 KB


4. Re: Sorting with parameters
luciana.suran May 29, 2014 2:09 PM (in response to Aaron Clancy)NOW I get it  thanks= you! My problem was using the "string" rather than the "integer" functionality...

5. Re: Sorting with parameters
Aaron Clancy May 29, 2014 2:12 PM (in response to luciana.suran)Excellent. String comparison works too, it's just much easier/faster to perform the logic with integers and the chances of missing a character is reduced when you're just comparing 1=1 or 2=2