Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello dears,
I have a list box including the Shamsi Months ( Months in Persian),
I tested all of the sort options (state,expressions,frequency...) but it does not get sorted as i wanted it to be.
I want to order them as it is in calender, apparently i have to sort them manually. but how?
thank you
Hi,
Create a new qvw file and use the below script
load * Inline
[
Month,Year,Amount
فروردین,2013,500
اردیبهشت,2013,500
خرداد,2013,500
تیر,2013,500
مرداد,2013,500
شهریور,2013,500
مهر,2013,500
آبان,2013,500
آذر,2013,500
دی,2013,500
بهمن,2013,500
اسفند,2013,500
فروردین,2014,500
اردیبهشت,2014,600
خرداد,2014,600
تیر,2014,600
مرداد,2014,600
شهریور,2014,600
مهر,2014,600
آبان,2014,600
آذر,2014,600
دی,2014,600
بهمن,2014,600
اسفند,2014,600
]
Save and reload
Now drop your Month Field list box to your front end application.
Right click on month properties sort tab --> Select load order reversed.
Look at capture.jpg image attached.
Or
use the below expression to sort
=Match(Month,'اسفند','بهمن','دی','آذر','آبان','مهر','شهریور','مرداد','تیر','خرداد','اردیبهشت','فروردین')
Create bar chart with month as dimension and sum(Amount) as expression
Again go to chart properties --> sort tab of chat--> Select load order reversed.
Or
use the below expression to sort
=Match(Month,'اسفند','بهمن','دی','آذر','آبان','مهر','شهریور','مرداد','تیر','خرداد','اردیبهشت','فروردین')
Look at final output capture1.jpg
Regards
ASHFAQ
Hi arman
In the Sort Options you'll see Expression, Check that Option and paste this Expression Accordingly:
Dual("Your Month Field",match("Your Month Field" ,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'))
Since, I don't know Shamsi Months, so set accordingly and sort in Ascending or Descending Order.
Suppose, if you want Jan after Mar than do change in Expression Order.
Here, Month is your Shamsi Months Field Name.
Replace Month with your Application Month Field.
Hope that helps.
Regards
Aviral Nag
Thank You for your answer, what if i use month field as a dimension in a chart? suppose i want to see the sales trends of year 2013, how can i reorder the month fields there?
For this case, use the Same Expression.
Dual("Your Month Field",match("Your Month Field" ,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'))
Here, your Your Month Field is the Dimension Month which you have used in your chart.
Regards
Aviral Nag
i did what you said for sorting the month list box, but it did not change at all, what do you think might be the reason?
what can i do?
i checked the code a couple of times. i even copied your scripts and just changed the month names
Can you attach your application here. I'll from my end.
Hi,
use the below expression for sorting
=match("Your Month Field" ,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')
If possible try to share sample data.
Regards
ASHFAQ
Unfortunately, I don't know how to attach a file, but my original table is like this:
Year | Season | Month | SubID | City |
---|---|---|---|---|
2014 | spring | jan (actually in Persian calendar 'فروردین') | 113333 | city 1 |
2013 | winter | feb('اردیبهشت') | 112222 | city 2 |
2012 | summer | ... | 114444 | city 3 |
though the problem applies to other fields(Year,Season) but since the number of them are limited, it is not important that they are not sorted, but month list box has 12 values and it is much more convenient to have them sorted.
when i use the last scripts, it does not sort the months and also by selecting months in list box, they move with no order. it is weird.
Hi,
Still I would suggest you to upload sample document with some data.
SeePreparing examples for Upload - Reduction and Data Scrambling for how to do that.
Regards
ASHFAQ
dear ashfagh, thanks for the tip
here is the sample data. the field of month is : [Shamsi Month],