How to find last month of rolling year in tableau? - tableau-api

I have a requirement in which I have to show the data of last month of each year. So I used a max_month LOD expression which is working fine for all the years except rolling year. My rolling year ranges from Aug 2017 to July 2018. Now when I am using max_month filter for rolling year it is showing me the data of december 2017, but in actual I want to show july 2018. What will be the right approach to fix this?

I am not sure even if your formula worked, its missing basic syntax, and based on your explanation table calculation is missing the Computation logic.
Implemented the same at my end and below is the logic.
Formula to be used:
If MAX(MONTH([Order Date]))=WINDOW_MAX(MAX(MONTH([Order Date])))
THEN 'TRUE'
ELSE 'FALSE'
END
For this table calculation you need to compute along year and corresponding dimension and reset at every year (I guess you are missing this in your current logic).
Let me know how it goes

Related

Power Bi : visualization problem with year over year change

I have created a visualization that gives me the percentage change in the number of sales from one year to the next.
This visualization varies according to a date filter.
I have data since March 1st 2021.
Here is my problem: If I filter on the period "January 1, 2022 to October 1, 2022" I have a problem with my visualization, it will be false because it will compare this period of 9 months with the same period in 2021, except that in 2021 I am missing 2 months (January and February 2021).
Do you know if it is possible to display nothing on this visualization if the filtered period starts before March 1st 2022?
I prefer to display nothing rather than a false value.
i think a solution here would be adding a parameter to the visual instead of a slicer.
With the formula if & else.

YoY growth in Tableau

I am trying to get YoY percent growth in Tableau. I would like to see 2015 Jan Unique customers vs 2014 Jan Customers and so on and so forth till the last set of data.
When doing this in Sample super store, I get the following viz.
What I am looking is for a continuous view where the years are not broken down. Something similar to this:
Any suggestions on how I can get to the final stage.
Thanks
If you just use the year in columns, you should get the desired result (Remove the month from column). If it is still creating issues, you can create a calculated column which just has the year and use it in the visualization. The following link should guide you through the steps (Except its a bar chart, so the year would have been converted to discrete. You should be fine with continuous):
https://www.bounteous.com/insights/2015/09/17/how-make-yoy-bar-charts-tableau/
Hope this helps.

I need to take out duplicates from date column in cross tab in crystal report 8.0

​In cross Tab:
One column is date. I need to show only month in following order fiscal year order:
April
May
june
July
August
September
october
november
december
january
febuary
march.
It should not be more than one time. While I am trying I am getting duplicates months in the column.
it may happen because of many causes. My opinion is, you should put some screen shot or your codes here, so it easier for experts to understand you problem.
this is what i can suggest to you
if you have many tables linked together, please double check if the link is correct or not
OR
you can select Database-->Select Distinct Record at the menu

Altering x-axis for dates in Tableau

I have a data set that has dates for many years. I can easily filter the data by month or week, but I was hoping to change the X axis to make it start in October and end in April.
Is there a way to do this in Tableau without altering the original data and listed dates?
I don't know about it ending in April since that would not be a full 12 months but you can make it start in October. Right click on your date field > Default Properties > Fiscal Year Start. Then select October.

Table Calc - with IF statement? - Tableau

We have YTD data only. I've been trying to get a MTD running across the table.
So I thought I can run a Table calculation type - "Difference From" previous month.
This works well except for the first month of the year.
Jan MTD = Jan YTD NOT Jan YTD less Dec YTD
So January numbers are never right.
Is there a way to say, If month = "Jan" don't perform the table calc?
regards
Gem
You probably have something like
ZN(SUM([YTD])) - LOOKUP(ZN(SUM([YTD])),-1)
Then, for the first entry, LOOKUP() will return null. All you need to do is to return 0 instead, using ZN()
ZN(SUM([YTD])) - ZN(LOOKUP(ZN(SUM([YTD])),-1))
In case you don't know, you need to go to Edit Table Calculation..., then Edit Formula...
EDIT: I understand you have a bigger problem, that is your rolling sum restarts every year. In that case you really need an IF statement, but it is possible to overcome your "it's not always the same starting month" problem. You just need to check if that month is the first in your list or multiple of 12:
IIF(-FIRST()%12 = 0,
ZN(SUM([YTD])),
ZN(SUM([YTD])) - LOOKUP(ZN(SUM([YTD])), -1))
You just have to understand the FIRST() function. It will return the distance from the current position to the starting position. So, if you start in February, in August First() will return -6.
And the modulo operator will guarantee you restart every 12 months
Thanks Inox.
You are correct.
However I was intending more like this:
IIF(min(month([period_date]))=1,
ZN(SUM([YTD])),
ZN(SUM([YTD])) - LOOKUP(ZN(SUM([YTD])), -1))
Since the formula is an aggregate, I had to use "min" for the date. That was my problem using the IIF function, which was not apparent in my question.
This will produce MTD beyond 1 year, When it reaches the second January, it will not subtract Dec YTD.
Only problem I have now though is, if you begin the table on a month other than January... ie Feb.
Feb MTD is not Feb YTD??
(this is another problem, my report is to produce a rolling 12 month)... ie Feb to Jan, Mar to Feb)
So far, I'm just displaying 2 years to get over this, so forcing it to start on January. Not really a solution, but it gets the information across 12 months.