Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have some issue in bar chart where am unable to get sortout the yearmonth values in order.
Dimension:YearMonth.
REQ:in chart need to show values as
2015 oct
2015 nov
2015dec
2016jan
2016feb chk below my chart and sort tab;
2016mar
Create your Month_Year field as a date in the script: Date(MonthStart(MyDate),'YYYY-MMM') as Month_Year. Then sort it by Numeric Value in the chart.
Change your selection to Numeric Value
Create your Month_Year field as a date in the script: Date(MonthStart(MyDate),'YYYY-MMM') as Month_Year. Then sort it by Numeric Value in the chart.
Create your YearMonth field as a proper datetime field and you can sort it numerically.
If you get the YearMonth as a text field from your source, then convert during the load:
LOAD ...
Date#(YearMonth , 'YYYY-MMM') as YearMonth,
...
if i change to numeric...also its not givng
Your monthyear field is in string format. Make it in Number format like below
date(date#(MonthYear,'YYYY-MMM'),'YYYY-MMM') as MonthYear
Now go to Sort tab and sort it by Numerical values.
Hi,
It seems that the values (YearMonth) is a string. You must use the date format to get the values in numbers and then they will be sorted as per your requirement.
Use below function to get the Year Month.
Date(Date,'YYYY-MMM') as YearMonth
Regards,
Kaushik Solanki
Hi, Have you tried to checked Load Order Original and uncheck from all.
Hope it helps
yes...its not working.
"The first thing you should be aware of is that there are two different functions: Date#() and Date(). The first is anInterpretation function and the second is a Formatting function". That is from this link...good stuff: The Date Function
This is what a possible solution for you would look like.
LOAD
Date#(MyTextDate, 'YYYY-MMM') as MyDate,
MyValue
;
LOAD * INLINE [
MyTextDate, MyValue
2015-Dec, 63
2015-Nov, 52
2015-Oct, 42
2015-Sep, 79
2016-Feb, 31
2016-Jan, 34
2016-Mar, 36
];