How to get only the first 6 months action of all my records - tableau-api

I'm pretty new in Tableau. I have looked at the forum already and the answered suggested. But I'm not quite sure it match my question.
I have a bunch of records. This is about registration for a sport lesson depending on time. All of them have a start date and and some of them a finish date. The other never finish (They continue until date T with T = now).
My goal is to compare only the first 6 months of all my records, I think there are 50 of them, like the evolution during this period of time. So, for some the start date would be in January 2009, for some other, it would be in May 2016, etc.
As field provided, I have the start date and the number of person that have subscribed those lesson through time.
So, do you if there is any to achieve this goal? Is there enough detail for you to understand what I am saying ?
Thx to you guys !!
EDIT
You can find enclosed a screenshot of the result that I already have.
number of registration for all lesson through time
I'm not sure to be clear, what I try to do is to compare the first 6 months only of each courses. So the evolution of the first 6 months of this course compare to the evolution of the first 6 months of this other course and so on :)

If I understand your question correctly you are wanting to show only the first six months of your data but you want this by each category.
I am assumuming that by definition this means 6 months from the first record in your data for each category.
In order to achieve this I would create a true/false flag using a level of detail expression. As you are new to tableau I would suggest you do some reading on this but basically you can force a calculation to be at a certain level of the data rather than at the row level. You use this to find the minimum date in the table and then use a date diff to return true if the actual date field is within 6 months of this.
Create a calculated field as follows:
[date] <= DATEADD('month', 6, { FIXED [category] :min([date])})
Then drag this onto your filters pane and select "TRUE". This should give you only the first six months of records for each category.
Let me know if you need anything else.

Related

Acumatica, creating a generic inquiry with a condition on a field equal to the previous day

I have created a simple generic inquiry that shows some data after joining two tables. I am now struggling to implement a condition that should make the result only contain rows where a date field is equal to yesterday date.
I am a bit annoyed as Acumatica has created the method `today()` neatly, but not a `yesterday()` or `tomorrow()`.
Does anyone have a good solution that they care to share?
Help is much appreciated,
Cheers.
P.s
I have made this very hackish solution that somewhat works, but breaks between change in month or year.
=CStr(Year(Today()))+CStr(Month( Today() ))+CStr( Day(Today())-1)
Okay, so I found the solution to my problem!
I read that Acumatica is coded C# and.NET which made me think of how adding dates is done there. You utilise the DateAdd(date, interval, number) under the time tab to create relative changes to date.
In this case, the date is the time source from where you want to change, interval is in which interval/dimension you wanna move, for example, 'd' is for days. You can find more prefixes here: crosspost. Lastly, number is how much you want to change in the interval, in my case -1.
TLDR; Use DateAdd(Today(), 'd', -1) to get the previous date in relation to the current date.
You can simply write Equals to #Today-1 for Yesterday like below:

How to correct the order of the year in Qliksense?

My data contain a column showing the year of each record, ranging from 2005 to 2017 I am using the Time Slide extension (https://github.com/caallard/Time-slide) to help me visualize the data. However, the order of the year is problematic.
As shown in the following plot, the first year in the slider is 2006, while the last year is 2005, which means the first year somehow shifted to the last.
I further checked my data. When I uploaded my data to the Qliksense, the preview of the data in the data manager window looks like the following. The year is not in the right order. Perhaps this is related to my question.
I would like to learn how can I fix this. Thanks.
Edit
I have a workaround for now. There are two tables in my Qlik sense both have a column showing Year. Previously I linked these two tables with the Year column. I just deleted that link, and reference my time slide to the Year column from the other table. The sequence of the year in my time slide is normal now.
Here is the preview of the year column from my other table. The order of the year is normal, and I believe since I added this column to my time slide, the order of the time slide is normal accordingly.
However, the original year column I showed before is still in the wrong order. This is strange.
Edit 2
If I select the Time Slide extension in edit mode, below is the available under the Dimension. For the Sort by Numeric and Sort by Alphabetical, they both have three options: No, Ascending, and Descending. However, switching between these options does not affect the order of the year in Time Slide.

Change date from calander date to date since first record in tableau

So, pretend I'm looking at sales of an item vs time. One item I started selling 3 years ago and one is from only a year ago.
I want to look at how the performance of both items change starting from first date sold as "day 0" not from first date sold as say "march 2016".
My date field is a calendar date and I'm not sure the best way line everything up from within tableau that will allow me to display the result on a single graph. I'd also like an option that will scale to 10+ items
Any approaches would be great!
Create a calculated field called first_Sale_date_per_item defined as {fixed Item : min(sale_date)}
Then you can define days_since_first_sale as datediff('day', first_sale_date_per_item, sale_date)

Creating Bins in Tableau for Days in a Week

Could someone please explain me creating BINS based on Weekdays in Tableau? I tried creating different Calculation Fields but it won't work
You're working too hard.
Tableau already knows how to bin values by dates at many levels of granualarity: such as year, month, day, weekday, hour etc. So you don't need to create a new field to bin dates by the day of the week. (creating bins is not difficult, it's just already available in this case)
Just put a discrete (blue) date or datetime field on a shelf. You'll see the date level of granularity displayed like, say, YEAR(MyDateField) with a leading plus sign.
You can either
click on the plus sign to drill down by adding a second level, say MONTH(MyDateField)
or
right click on the field to select the date level of granularity you want
Alex's Answer is exactly correct, Tableau will perform the operation automatically. What is great about is that you can select various formats (Full day name, number, 1 letter or 3 letter day etc.).
However if you absolutely need to you can used this formula:
datepart('weekday',[Date])
to give you the 1 (Sunday) to 7 (Saturday) value if you need it for something other reason, say another calculation.

sqlite3: retrieving data based on month and year from local database in iphone

In my application I have to store data month wise and year wise. So for this, I have to store the data along with date into database.
My requirement is how to store in terms of date and how to retrieve data with group by month and year. In my app I am showing a table of years and months, based on selected month and year. I have to show the data in a dashboard.
My problem is in storing and retrieving date data types.
Use the following syntax
SELECT * FROM DATABASE WHERE REQUIREDDATEFIELD LIKE '%2011-01%';
2011 is supposed to be the year
01 is supposed to be the month
DATABASE is supposed to be your mysql database name
REQUIREDDATEFIELD is supposed to be the field you are hoping to sort from month and year.
like '%2011-01%' is supposed to be meaning, all the records containing 2011-01 in the given field. It could be in the beginning or the end or in the middle of a large text, so having % in both the beginning and end of the search criteria is a good habit.
You just select either for a specific month or year or month and year. Or if you want all, you use GROUP BY.
I know this answer is quite vague and generic, but that's because your question is vague. You probably need to be more specific. Explain not only what you want to do, but what you have tried, and in which way that didn't work.