Logic for showing only Company related to particular financial year in table chart in Qlik sense - charts

(FINANCIAL YEAR) --- Its a filter
COMPANY FINANCIAL_YEAR
A 2021
B 2022
C 2021
D 2021
E 2022
F 2022
I have a table with different companies. The requirement is that if any particular FINANCIAL_YEAR is selected from filter pane then companies founded in that Particular FINANCIAL_YEAR should only show up. For eg if 2021 is selected then companies founded in that year show up same for 2022 and other year also and by default it show companied founded in current FINANCIAL_YEAR. Also this should be completely dynamic.
(FINANCIAL_YEAR) -- 2022
Company Name
B
E
F
Same for FINANCIAL_YEAR 2021 and if no year is selected then it should show comapnies founded in 2022 i.e current FINANCIAL_YEAR 2022

Related

DAX Expression for calculating end of every year

I am looking for DAX expression to show me monthly figure for last financial years. Here is an example of the information;
The figure is accumulated since the starting of 31 Jan 2017 or earlier which I have no information. The data I have does not have a monthly view but Year to Date (YTD).
How could I structure the DAX so that it would be able to find out what is the figure for the month.
For example, Jan 2017 $2,000 , Feb 2017 $5000 (included figure from Jan 2017), March 2017 $8000 (included Jan 2017 and Feb 2017).
How can it be done to have the monthly view ?
Date............. Balance Sheet Amount.......View
31-Dec 2017................24,000.......................YTD *1
31-Jan 2018................24,010.......................YTD *1
28-Feb 2018................24,310.......................YTD *1
31-Dec 2018................30,000.......................YTD *2
31-Dec 2019................31,000.......................YTD *3
31-Dec 2020................40,000.......................YTD *4
30-June 2021................5,000.......................YTD *5
Let's say your current table does not contain previous balance, then it will be easier to obtain the current month movement with the following formula:
Current Month = Sheet1[YTD Bal] -
CALCULATE(SUM(Sheet1[YTD Bal]),
FILTER(Sheet1,Sheet1[Index] = EARLIER(Sheet1[Index]) - 1))
Before you start the dax calculation, you will need to add index column first and here is the output:

How to display previous year totals into current year in Tableau??without creating parameter

I need to create a field of previous year total sales in the current year column.
Here is an example based on it being 2018 today: in 2018, it should be 2017 total sales(full year), in 2019, it should be 2018 Sales(jan-apr would be only months in may), and 2020 should be blank, as there are no data in 2019 yet, etc.
Use the calculation to make it as "Date-1".

Year and month in a crystal report

I have designed student ID Card using crystal report version 13_0_9 for visual studio 2013.
There 2 fields on student ID card that reflect year and month. For the field year I need to show it as 2015 - 2016. And for month it need show as June To May.
I tried placing two special fields for year, month and formatted to show only year and month value.
But the fields reflect only current year and month, how do I achieve this to reflect year as 2015 - 2016 and month as June To May. See below Image.
https://onedrive.live.com/?cid=9F3DE61006533307&id=9f3de61006533307%211621&v=3
A formula called Year:
cstr(Year (CurrentDateTime),"#") & '-' & Right(cstr(Year (CurrentDateTime) + 1 ,"#"),2);
and one called Month
cstr(CurrentDateTime,"MMM") & ' to ' & cstr(DateAdd("m",11,DateAdd("y", 1, CurrentDateTime)),"MMM")
I'm on Crystal standalone but should work equally in VS 2013

How to subtract two dates in Oracle and extract the year part from the difference?

My typical requirement is that I want to subtract two Dates cast as timestamp. The Minuend (First parameter) is the current date and the Subtrahend(second parameter) is stored separately as DD, MM and YYYY in three columns. The final output should be a discrete year as number. I am playing with something like :
SELECT (TO_DATE('05-DEC-2013') -
CASE LENGTH(CAND_DOB_DD)
WHEN 1 THEN
CAST(TO_DATE('0'||CAND_DOB_DD||'-'||CAND_DOB_MM||'- '||CAND_DOB_YYYY,'DD-MM-YY HH24:MI:SS')
AS TIMESTAMP)
ELSE
CAST(TO_DATE(CAND_DOB_DD||'-'||CAND_DOB_MM||'-'||CAND_DOB_YYYY,'DD-MM-YY HH24:MI:SS')
AS TIMESTAMP) / 365 END YEAR
FROM CANDIDATE
The Year part as Integer will be used for a very sensitive calculation. Please suggest if the above piece of SCRIPT will yield the desired result. Thanks in advance.
For most purposes you could just use the Months_Between() function to determine the number of months between two dates, and then divide by 12 etc.. Note that the number of months is an integer when comparing two dates that have the same day of the month or are both the last day of the month.
This is tricky when it comes to leap years.
Do you count 28th Feb 2015 to 28th Feb 2016 as exactly one year, when 28th Feb 2015 to 29th Feb 2016 is one day longer but plainly is a year?
What about 29th Feb 2016 to 28th Feb 2017, or 28th Feb 2016 to 28th Feb 2017?
Think carefully about these boundary cases, but Months_Between() is likely to be your best choice.

Crystal Reports putting a group in different columns

I'm trying to take one group and put it in two different columns. I know you can do that for the details of a group in the section expert but it won't allow you do so for a group. The group is date that I've separated by months for the all of last year and this year to the current date and I want last year's months in one column and this year's months in another column. Like this:
January 2011 January 2012
February 2011 February 2012
March 2011 March 2012
April 2011 April 2012
May 2011
June 2011
July 2011
August 2011
September 2011
October 2011
November 2011
December 2011
That way the months are easy to compare and they can be drilled down. Any ideas?
In Details section's 'Section Expert', select 'Format with Multiple Columns'
Select the (now visible) Layout tab
Select 'Format Groups with multiple column'
Add a second group on your date field by year (make sure it is 'outside' the mm/yyyy grouping)
Size the footer of the section you created in #4 to get each year to be in its own column
If you group by month name (like monthname({transaction.date}) so January 2011 and 2012 will be in the same group) then you can use a running total to summarize the years individually within that group. You can do this by creating two running total fields, one with an evaluate formula like year({transaction.date})=2010 and another with the formula year({transaction.date})=2011.
Note that running totals won't work in the group header though, so you'd need to migrate those fields down into the group footer instead.
How about using a cross-tab like:
2011 2012
January 10 12
February 5 12
March 8 1
This would be a lot more flexible.