Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
prasadreddy
Contributor III
Contributor III

Sorting calculated dimension

  Hi All,

Below is my calculated dimension, so, i want to sort the bar chart by 'Month_Name' wise,

Month contains the data like: 201301, 201302, 201303, 201304

Month_Name: Jan, Feb, Mar, Apr

Please update me ASAP,

Thanks in advance

=

IF($(v_OVar1) = 0,

Month_Name& '-' &

Left(

[Month],4),

IF(

FY_Quarter='Q1',

Qtr_Month,

IF(

FY_Quarter='Q2',

Qtr_Month,

IF(

FY_Quarter='Q3',

Qtr_Month,

IF(

FY_Quarter='Q4',

Qtr_Month
))))
)

9 Replies
bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

you could use the dual function or load the data in the correct order, so you could sort by load order

israrkhan
Specialist II
Specialist II

as Barini said above, one more idea is you can load inline like,

LOAD * INLINE[

NO, MONTH

1, Jan

2, feb,

3, mar

...

....

....and so

];

THEN USE EXPRESSION IN YOUR SORT ORDER, ON NO...

Anonymous
Not applicable

Israr

Or simply sort using expression :

     num(mid( [Month] ,5,2))

or you could use this expression if you prefer:

     num(month(date#( [Month_Name] ,'MMM')))

Best Regards,     Bill

prasadreddy
Contributor III
Contributor III
Author

Hi Bill,

In my bar chart, it should show months on X-axes, but it showing order like,

Feb, Mar, Jan, Dec, Nov,

But i want to show like:

Nov,  Dec, Jan, Feb, Mar,

saumyashah90
Specialist
Specialist

in properties Sort->Numeric Value

tresesco
MVP
MVP

If your sort order is fixed as Nov, Dec, Jan... Then in the sort tab select your calculated dimension and write in expression : =Match(Month_Name, 'Nov','Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct')

If this does not work, please share your sample app.

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi, you have to add the year, I think Nov and Dec are 2012, whereas the other month are related to 2013.

CELAMBARASAN
Partner - Champion
Partner - Champion

You can use something like

IF($(v_OVar1) = 0,

Dual(Month_Name& '-' &

Left(

[Month],4), [Month])..

prasadreddy
Contributor III
Contributor III
Author

Hi tresesco,

I tried this, but still it is showing order like:

Feb, Mar, Jan, Dec, Nov,