#Tableau

Поділитися
Вставка
  • Опубліковано 18 кві 2022
  • In this tip, I show you how I calculate year over year change based on a date selected with a parameter. The use case is to calculate YTD sales depending on the date selected and compare it to the prior YTD sales for the same period.
    Download the workbook here - www.vizwiz.com/2022/04/ytd-vs...
  • Наука та технологія

КОМЕНТАРІ • 80

  • @mmmaxmmm83
    @mmmaxmmm83 2 роки тому +3

    Awesome simplicity involved here, love that calculation! Never would have thought about using the boolean like that.

  • @anthonyburns7278
    @anthonyburns7278 5 місяців тому

    Did a great job of describing CYTD vs PYTD calculations in a short and simple manner! Super helpful video! Thank you

  • @haniharun3267
    @haniharun3267 4 місяці тому +1

    Thank you. It's simple and easy to follow for beginners. Love this!

    • @vizwiz
      @vizwiz  3 місяці тому

      So glad!

  • @SuperDhruv123
    @SuperDhruv123 Рік тому

    Thank You Andy, this solution works perfectly, very simple and precise. I have seen other solutions online but they are unnecessarily complex

  • @dantheman-adadwithchores4857

    Great video. Just what i needed. I incorporated this with another video for adjusting to a specific fiscal year. Thanks!

    • @vizwiz
      @vizwiz  Рік тому

      Glad it was helpful!

  • @jacobblalock8218
    @jacobblalock8218 Рік тому

    Thanks for the post Andy. Our business deals with lengthy financial blackout periods. This solution lets us quickly get an apples-to-apples comparison just by selecting a date.

    • @vizwiz
      @vizwiz  Рік тому +2

      Fantastic. That’s a great use case.

  • @RajivPerera
    @RajivPerera Рік тому

    Thank you Andy. This is exactly what I was looking for.👍

    • @vizwiz
      @vizwiz  Рік тому

      Glad it was helpful!

  • @farrukhkidwai
    @farrukhkidwai 2 роки тому +4

    Thanks! This gets complicated if the fiscal year does not start from January. QTD and MTD are a nightmare to build if say your Fiscal year starts from Feb.

    • @vizwiz
      @vizwiz  2 роки тому

      Correct. This tip doesn't address that.

  • @yiyit5259
    @yiyit5259 Рік тому +1

    This is helpful! However, I am stuck with how to apply this to FYTD calculation - especially, how to create a field that is the current fiscal year start date, so that I can use that as my lower bound for if [order date]>= current fiscal year start date and [order date]

  • @joelvargas8397
    @joelvargas8397 Рік тому

    This is great. The challenge I have is exclude the current month and my prior year calculates data including the same time current month. I would like to know how I can do it so it excludes last year the current month.

  • @sunishhkv4830
    @sunishhkv4830 5 місяців тому

    This is helpful, I have a similar scenario and pulled out the YTD percentage for the last 3 years, I also wanted to display which records have been newly added/removed along with the YTD calculations, how is that possible

  • @guest-pj1kn
    @guest-pj1kn Рік тому

    Hello, how can we handle if its QTD vs previous QTD at selected date? if we use same logic as YTD, 1st quarter gives us 1 and we cannot minus 1 from that. Thus it does not work on every year's first quarter range. How to make counter that last quarter which is 4th is prior from next year's 1st quarter?

  • @JayShah910
    @JayShah910 2 місяці тому

    Thanks Andy

  • @enter-mation5890
    @enter-mation5890 2 роки тому

    Thanks Andy, I learn new things from every tip that you post here.
    Can we also do week day to last year week day visual comparison (like saturday week 10 vs saturday week 10 last year).

    • @vizwiz
      @vizwiz  Рік тому

      Of course. I would do it by getting the day of week number and the year number then create the calcs based on those.

  • @newbs825
    @newbs825 Рік тому

    This video was very helpful, but I have mutliple year data and there are measured values already established. What I need to see is if I run my report on any given date, and I'm using a specific range whether a calendar year or fiscal year ie I'm running a report today, the range of dates are 7.1 - 9.30 - I need assistance with muliple years data - not just 1 or 2 years.

  • @parvezshahid8906
    @parvezshahid8906 7 місяців тому +1

    Hey Andy, instead of sales, lets say I wanted to input an average units per order value, how can I do that without getting the cannot mix aggregate and non aggregate error?

  • @RupeshM108
    @RupeshM108 Рік тому

    Very helpful and good Explanation 👍

    • @vizwiz
      @vizwiz  Рік тому

      Glad it was helpful!

  • @pravinjoshi72
    @pravinjoshi72 Рік тому

    You made it easy Andy!
    I feel Tableau needs to offer readymade functions to do these calculations. just like how Power BI does it.

    • @vizwiz
      @vizwiz  Рік тому

      Glad it was helpful!

  • @TH-vw4qn
    @TH-vw4qn 2 роки тому +1

    Great video! Would you please do a video where the percentage difference font color would change to green if it's positive and red if it's negative?

    • @vizwiz
      @vizwiz  2 роки тому

      I did this in my Watch Me Viz yesterday since you asked. 👍🏻
      Watch Me Viz - #B2VB 2022 Week 4 - Designing KPIs
      ua-cam.com/video/cYVBduPExfo/v-deo.html

  • @iwishknewit4179
    @iwishknewit4179 2 роки тому

    Hi Andy, I have a situation where the dashboard has to show monthly views of some KPIs and visuals. KPIs are current month(selected month from filter) compared to the previous month %diff. Other visuals are monthly snapshots of sales and profits. I calculated Lookup filter to achieve %diff. However I cannot use it as a global filter across the workbooks. This is preventing me use this solution. Please, do you have any suggestions?

    • @vizwiz
      @vizwiz  2 роки тому

      It’s not working because table calcs are only available in one sheet. You’ll need to have an LOD calc that you can apply across both.

  • @sahanahebbar2345
    @sahanahebbar2345 4 місяці тому

    Thank you for the video. I want count(order id) comparison for the selected date. How can I do that?

    • @vizwiz
      @vizwiz  3 місяці тому

      Replace the aggregation I have sum of sales I believe, with your countd

  • @Superstarmamba24
    @Superstarmamba24 4 місяці тому

    Hi @Andy, this is great video and i appreciate it. But how would i go about using Months instead of Specific Date to show the data? Thanks again

    • @vizwiz
      @vizwiz  3 місяці тому

      Change the date aggregate.

  • @schmiedk1
    @schmiedk1 Рік тому

    So to do prior year mtd and qtd I just need to add another boolean AND statement to the calculated field using month/quarter right?

    • @vizwiz
      @vizwiz  Рік тому

      Sounds about right

  • @anthonyburns7278
    @anthonyburns7278 5 місяців тому

    Thanks!

  • @Mustafawi
    @Mustafawi Рік тому

    Great tip, Andy! I assume that using the same logic, we can create a start and end date parameter for year over year comparison?

    • @vizwiz
      @vizwiz  Рік тому

      That should work. 👍🏻

  • @andrea2686
    @andrea2686 Рік тому

    THANK YOU SO SO MUCH SIR, this is what i look for TT

    • @andrea2686
      @andrea2686 Рік тому

      but sorry, can I have the explanation about the INT() then multiply by Sales?

    • @vizwiz
      @vizwiz  Рік тому

      INT changes a Boolean (T/F) into 1 or 0. You then multiply that by sales so you either get sales (when true) or 0 when false.

    • @andrea2686
      @andrea2686 Рік тому

      @@vizwiz so, it will cumulate all the true value multiply by sales? Let's say we have 18 rows which are true, so the function be like this : (row1 × sales.row1) + (row2 x sales row.2) + .... + (row18 × sales.row18)?🙏

    • @vizwiz
      @vizwiz  Рік тому

      Not quite. It’ll multiple each true row by 1. So it’d be 1*row1 + 1*row2,etc

    • @andrea2686
      @andrea2686 Рік тому

      @@vizwiz I see..... I got it, sir! Thank you very much. It really helps. Stay healthy and inspire sir😊

  • @gokulsutar1696
    @gokulsutar1696 Рік тому

    if i have old data source then how to calculate for Previous YTD sales

    • @vizwiz
      @vizwiz  Рік тому

      It's based off of LODs, so it'll always use whatever your latest dates are. If you have a newer data source, then the calculations will automatically update.

  • @edmarreyes4956
    @edmarreyes4956 Рік тому

    What if you want it to filter by year/yearly? is it possible? Thank you

    • @vizwiz
      @vizwiz  Рік тому

      Yes. You would need to add the years you want to filter out as data source filters, preferrably.

    • @edmarreyes4956
      @edmarreyes4956 Рік тому

      @@vizwiz Thanks for your response. I have a filter order date yearly. I cant figure it out when ai filter it yearly it doesn't change the prior ytd value. I dont know what calc need.

    • @vizwiz
      @vizwiz  Рік тому

      @@edmarreyes4956 what’s the calculation you’re using?

  • @johnshecut3016
    @johnshecut3016 Рік тому

    Is it possible to create a calculated field that gets the sum of sales for all time? So as in the sum of sales from now to as far back as the data goes? I'm trying to subtract sales from all time minus sales of YTD

    • @vizwiz
      @vizwiz  Рік тому +1

      { SUM([Sales]) } would give you total sales

    • @johnshecut3016
      @johnshecut3016 Рік тому

      @@vizwiz Thank you very much!

    • @vizwiz
      @vizwiz  Рік тому

      You’re welcome. Thanks for watching.

    • @johnshecut3016
      @johnshecut3016 Рік тому

      @@vizwiz One more question do you know how to make a ytd calculated field a COUNTD type of variable so lets say it was something like Customer id or Order id? I'm trying to know the exact amount of customer ids were in this year vs the prior year.

    • @vizwiz
      @vizwiz  Рік тому

      @@johnshecut3016 probably something like
      If year(date) = {max(year(date))} then product_id end
      That will look at each row and if that row is the current year, it’ll return the product. Then you can wrap set the aggregation to a countd.

  • @johnshecut3016
    @johnshecut3016 Рік тому

    How do you do month year date to previous month year date

    • @vizwiz
      @vizwiz  Рік тому +1

      What’s month Year date?

    • @johnshecut3016
      @johnshecut3016 Рік тому

      @@vizwiz That's what I'm saying lol. But what I figured out is good for now but what they were wanting was YTD vs Prior YTD but only between January and May and I was able to do it. Your helped enough thank you

    • @johnshecut3016
      @johnshecut3016 Рік тому

      @@vizwiz And thank you for responding as well

    • @vizwiz
      @vizwiz  Рік тому

      @@johnshecut3016 No problem

    • @johnshecut3016
      @johnshecut3016 Рік тому

      @@vizwiz Is it possible to still have a year filter if your doing YTD vs PYTD calculations. For example you create the YTD vs PYTD calculation but you want there to be a year filter so you can choose a specific year and compare it to that previous year.