Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sarasmonu
Creator
Creator

Arrange Quarter-Year in Descending order

Hi All,

I have Quarter-Year information column in one of my Table.

I have been using that as Filter Dimension in my report. I want it to be arranged in descending order.

Eg: the way "Quarter-Year" column is in the table is:

Q4-2017

Q2-2013

Q1-2015 etc

Thanks

4 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Monu,

You could use a dual() statement to order in the way you want

Something like:

dummyData:

Load * Inline

[

Quarter

Q4-2017

Q2-2013

Q1-2015

];

NoConcatenate

Data:

Load

Dual(Quarter,Num#(mid(Quarter,2,1))+Num#(right(Quarter,4))) as Quarter

Resident dummyData;

drop table dummyData;

And you'll get the numeric representation of the Quarter (1,2,3,4) and Year as sorting parameter (giving as result the following):

Sample.png

MK9885
Master II
Master II

whatever your requirement is

Load* Inline [

Quarter-Year               Sequence

Q4-2017                         1

Q2-2013                         2

Q1-2015                          3

];

and so on....

Then use Sequence in your sorting...

Guess that should help

felipedl
Partner - Specialist III
Partner - Specialist III

Thing is Aehman his using a date field to do it, in your way, you'd have to manually input all the possible variants Q1,Q2,Q3,Q4 for how many years he wants to do it.

Should work but would be quite time consuming.

MK9885
Master II
Master II

Yea, if there are more values then it would be hard.