SAS EG date issue - date

i want to build a bar chart where the X-axis is month year ( example : NOV 2010)
in my dataset i got a column called MonthYear contains the month year value.
The problem is when i use the MonthYear column as the X-axis value , in the bar chart X-axis it come out numeric value (example : 14800 ...). I google out and found out that it is the date value in SAS.
i would like to know how can i display date as "NOV 2010" form on X-axis in bar chart.
i tried to change it into a character value column but it is sort alphabetically.

Add the format monyy7. on the MonthYear column of the source dataset.

Related

Sisense, display number of days in date filter

Have a date filter on the dashboard that allows for a custom date range:
Dashboard Date Filter
How can I add a the number of days in the filter to a formula? Just trying to show the number of days in column of a pivot table. In this example the date range is 45 days. The dataset doesn't have one record for each day, so a distinct count of days from the data set returns 42.
Is it possible to use the date from and date to filter values in formula? DDIFF([datefilter-from], [datefilter-to])
Extract the date from the fact table and create a dimension table which will contain all the dates.
Link the date column from fact table and dimension table. Use the dimension table's date column in filters.

PowerBI Matrix with Year and Month

In the matrix below I have data from Jan 2020-Jan 2021, where the Jan column has the data from both 2021 and 2021. Is there any way to have the matrix add another column for Jan 2021 instead of aggregating that in with the Jan 2020 data?
Chose Year and Month in the date hierarchy column and then in the matrix click "expand all down one level in the hierarchy.
I am new to Power BI and I was wondering recently myself about something similar.
You can create a new column (text format) and combine month and year.
Date
Date Modified
dd-MM-yyyy
yyyy-MM
or
Date
Date Modified
dd-MM-yyyy
yyyy-MM (MMMM)
or
Date
Date Modified
dd-MM-yyyy
yyyy-MM (MMM)
It is not the most elegant solution, it changes a bit what is displayed (not simply months in the headers), it has a few disadvantages but it works.
I would be curious myself whether a better solution exists.
If you click on the date column you are using [InvoiceDate] and select the date option, it will separate out the two date values.
currently it is in a hierarchy showing just the month values but not the actual date
i have this but mine stays summed up at the year level even though the 'month' is expanded under the TimeByDay...
If I take out the year it will provide it like above but combines both... or as is it puts columns in the year

Power BI How to extract month and year from a date

I have a column containing dates in the following format: "28-SEP-2018 12.40.00", does anyone know how to extract the month and year from the date in a new column (i.e. Sep- 2018), via producing a measure.
#navee1990 the measure to extract the date and year is as follows
= MONTH([date] & YEAR([date])
Or the long way
CONCATENATE(MONTH([date]),YEAR([date]))
Assuming the type of the column is Text and you want the new values to be displayed as SEP-2018 rather than 09-2018:
You would need to create a new column with DAX as c1 = MID(Table2[Column1],4,8)
In case if the column is of type: DateTime ; then use the below DAX for new column :FORMAT(Table2[Column1],"MMM-YYYY")
New Date =FORMAT([date], "MMM") & "-" & YEAR([date])
This would give you a column with text data type. You can further create a column to sort the New Date column as per calendar chronology.

Conditional LabelsFormat on Report Builder Chart

I am trying to design a SSRS report where the end user can choose whether they want to view certain charts grouped by year or by month. The user chooses a value for the parameter #dategroup to determine this.
If #dategroup is "YEAR" the SQL groups and pulls row counts for the last 6 years. If #dategroup is "MONTH" it groups and pulls the last 6 months. The SQL is working fine, but I am struggling with getting the horizontal axis labels to format correctly on my report builder charts.
My query passes a "cte_date" column to the horizontal axis which is a date field. When the report is grouping by month I use the LabelsFormat properties grab the month part of the date. For example, if the query passes the value 2019-01-01 to the chart the LabelsFormat will convert that to "Jan". In this case the property LabelsFormat value is "MMM". When #dateformat is "YEAR", the horizontal axis in this case would be "2019", LabelsFormat "yyyy".
I have tried customizing the LabelsFormat property to
Iif(Parameters!dategroup.Value=YEAR,yyyy,MMM)
But this is not returning the desired results (month part if grouped by month, year part if grouped by year). Is there a way to format axis labels (which are dates) based on a parameter value?
The code in the question was close, it just needed some formatting changes. Add double quotes to the parameter value and formats. Enter the below code into the LabelsFormat property of the axis you want changed.
=IIf(Parameters!dategroup.Value="YEAR","yyyy","MMM")
If the #dategroup parameter is set to "YEAR", it will format the date to show just year. Otherwise, it will format date to the three letter month code.

compare extracted date with today() in excel

Column 1 : I have this date-time format in one column = 2018-10-08T04:30:23Z
Column 3 : I extracted date with formula = =LEFT(A11,10) and changed column format to date.
Column 32 : today(). Just to make sure both date columns match
Now when I want to compare both dates
Column 4 : =IF(C11=D11,TRUE(),FALSE())
It does not work. What did I do wrong?
One option using formulas only would be to use Excel's DATE function, which takes three parameters:
=DATE(YEAR, MONTH, DAY)
Use the following formula to extract a date from your timestamp:
=DATE(LEFT(A1,4), MID(A1,6,2), MID(A1,9,2))
This assumes that the timestamp is in cell A1, with the format in your question. Now, comparing this date value against TODAY() should work, if the original timestamp were also from today.
Should be worth trying:
=1*LEFT(A1,10)=TODAY()
May depend upon your configuration. Without format conversion (the 1*) you are trying to compare text (all string functions return Text) with a Number.