Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
Am new to QlikView and have recently started exploring the tool. It's mostly on trial and error method.
Am working on a Line Chart where am trying to sort Month by arranging them in the following order; Nov, Dec, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct.
So far I haven't had any luck in achieving the desired result. Please assist.
Regards,
Dev
One way is to create sort order in script before any other script is executed for a dimension field, like this -
Load Dual(Month,RowNo()) as Month inline [
Month
Feb,
Mar,
Apr,
May,
Jun,
Jul,
Aug,
Sep,
Nov,
Dec ];
TablefromScript:
Load *, Month(Date) as Month inline [
Date, Value
01/01/2018, 2000
03/01/2018, 4000
09/01/2018, 6000
02/01/2008, 8000
04/01/2008, 1000
];
Try this
Only({1} Date#(MonthField, 'MMM'))
One way is to create sort order in script before any other script is executed for a dimension field, like this -
Load Dual(Month,RowNo()) as Month inline [
Month
Feb,
Mar,
Apr,
May,
Jun,
Jul,
Aug,
Sep,
Nov,
Dec ];
TablefromScript:
Load *, Month(Date) as Month inline [
Date, Value
01/01/2018, 2000
03/01/2018, 4000
09/01/2018, 6000
02/01/2008, 8000
04/01/2008, 1000
];
Hi Sunny,
Thanks for responding to my query.
I tried the expression suggested and ended up as below;
For me, fiscal year starts with Nov and ends with Oct.
I need the months to be arranged in similar order.
Then I suggest fixing it in the script using a Fiscal Year Master calendar
Only({YourMonthField = {">=Nov<=Oct"}}YourMonthField)
Hello Hashim! Am retaining an error with the expression you have suggested.
Will it be possible for you to send a .qvd file?
Thanks Sunny! I'll give it a try.
Hi,
Digvijay's solution is perfect, just a clarification:
1. You need to load the first table BEFORE you load your Month field.
2. The Month field in this table must have the same name as in calendar/fact table.
3. You can safely drop the first table at the end of script.
4. When creating chart go to sort settings for the month field and select "load order"
Hope this helps.
Juraj
Yup, You explained it perfectly. If you feel you got what is needed, you may close this thread by marking correct/helpful answers.