Swift 3 FSCalendar select all dates by default - swift3

I am able to select certain dates while loading the FSCalendar. But I want to load calendar with all dates selected.
var attendance_list = [NSManagedObject]();
//After loading data
for attendanceObj in attendance_list{
let createdDate = attendanceObj.value(forKey: "date") as! String;
self.calendar.select(Utils.convertStringToDate(createdDate))
}
Above code is for selecting dates from an array.
How can I select all dates without any array ?

I wouldn't recommend selecting all dates since the beginning of time to the end of the foreseeable future (also, you cannot do it without an array). What I would recommend is getting the beginingOfMonth and endOfMonth (both methods are available) in currentPageDidChange (another available method). Then set the dates between these two dates to selected inside a loop.

Related

How to split graphs in two halves (15 days each)

I want to split graph in two halves of 15 day each using dates
i have tried using Top N filters Top and Bottom but when date range is changed i have duplicated graphs.
Split is happening using above filter but when i reduce date filter range duplicate data is shown in two graphs
i tried Flag = IF(DAY(MAX('Table'[Date]))<=15,1,2) as well but was getting data not in sequential order
I'm new to this any help will be thankful.
I just split it in half, rather than by 15 days. But you could change the math to use 15 days instead, if that's what you still want. Regardless, seeing this might help.
I started with a table like this, called Sheet1:
Then I created a chart like your original:
Then I created this DAX measure:
Chart Selector =
var minDate = CALCULATE(FIRSTDATE(Sheet1[Date]), ALL(Sheet1[Date]))
var maxDate = CALCULATE(LASTDATE(Sheet1[Date]), ALL(Sheet1[Date]))
var midDate = minDate + (DATEDIFF(minDate, maxDate, DAY)/2)
return
IF(CALCULATE(SUM(Sheet1[Date]),FILTER(Sheet1,Sheet1[Date]<=midDate)),"First","Second")
(You could change the midDate variable's calculation, above, to one that does 15 days instead.)
Then I made two copies of the chart and, in each copy, I added the new measure to the chart's filters. In the first chart's filter, I filtered for if it contains "First." For the second chart's filter, I filtered for if it contains "Second."
My end result looks like this:

Fetch Returns only 1 Row - Interactive Grid - Oracle Apex

I have an interactive grid which has a dynamic action to fetch returns from another table
begin
for c in (select
REW_SIZE,
IN_STOCK,
DESCRIPTION,
FINANCIAL_YEAR_ID
into
:REW_SIZE,
:IN_STOCK,
:DESCRIPTION,
:FINANCIAL_YEAR_ID
from
T_SORDER_PROFOMA_REWINDING
where so_id = :so_id)
loop
:REW_SIZE := c.REW_SIZE;
:IN_STOCK :=c.IN_STOCK;
:DESCRIPTION:=c.DESCRIPTION;
:FINANCIAL_YEAR_ID:=c.FINANCIAL_YEAR_ID;
end loop;
end;
When I had simple select into query, it gave "exact fetch returns more than requested number of rows" thn I applied the above code but it returns only 2nd row. I have 2 rows in the table for this ID.
For what I understand, you want to get some extra data columns. Your best shot is to create a view to join these table and deliver the columns you need. If you need editing, you will have to create an instead of trigger on the view as well, to do a correct dml on one or both tables.
create view which joins both tables
create instead of trigger (if you need editing)
query of the Interactive Grid should be on the view
This solution adds the extra data columns to the source of the IG, which is better and easier in my opinion.

Power BI - Creating a calculated table

I am creating a dashboard in Power BI. I have to report the executions of a process in a daily basis. When selecting one of these days, I want to create another calculated table based on the day selected (providing concrete information about the number of executions and hours) as it follows:
TABLE_B = FILTER(TABLE_A; TABLE_A[EXEC_DATE] = [dateSelected])
When [dateSelected] is previously calculated from the selected day as it follows:
dateSelected = FORMAT(FIRSTDATE(TABLE_A[EXEC_DATE]);"dd/MM/yyyy")
I tried a lot of alternatives as, for example, create individualy the year, month and day to later compare. I used the format in both sides of the comparation, but none of them works for me. The most of the cases it returns me the whole source table without any kind of filters. In other cases, it doesn't return anything. But, when I put a concrete day ...
TABLE_B = FILTER(TABLE_A; TABLE_A[EXEC_DATE] = "20/02/2019")
... it makes the filter correctly generating the table as I want.
Does someone know how to implement the functionality I am searching for?
Thanks in advance.
You're almost there Juan. You simply need to use dateSelected as a varialbe inside of your DAX query:
TABLE_B =
var dateSelected = FIRSTDATE(TABLE_A[EXEC_DATE])
return
FILTER(TABLE_A, TABLE_A[EXEC_DATE] = dateSelected)
Note that all my dates are formatted as Date so I didn't need to use a FORMAT function.
Here's the final result:
I admit that this behavior can be quite confusing! Here is a useful link that will help you understand Power BI's context:
https://community.powerbi.com/t5/Desktop/Filtering-table-by-measures/td-p/131361
Let's treat option 1 as FILTER(TABLE_A; TABLE_A[EXEC_DATE] = "20/02/2019") and option 2 as FILTER(TABLE_A; TABLE_A[EXEC_DATE] = [dateSelected]). Quote from the post:
In option 1, in the filter function, you are iterating
over each row of your 'Table' (row context). In option 2, because you
are using a measure as part of the filter condition, this row context
is transformed into an equivalent filter context (context transition).
Using variables (...) is very convenient when you want to filter
a column based on the value of a measure but you don't want context
transition to apply.

Date comparison in power bi dax

I had a problem with my code. It returns the below error:
DAX comparison operates do not support comparing values of type date with values of type text.
Basically, I want to count rows based on some conditions. And I know there is a need to convert the data type, but I am not sure how to do it.
Total Open Issues =
--------------------
--basic info
VAR SELECTEDDATE =
DATEVALUE(SELECTEDVALUE(Calender[FullDateAlternateKey].[Date]))
--------------------
--FIND the relvent data
VAR rlvttable =
calculatetable(
Tracker,
Tracker[Catagory]="ISSUE",
DATEVALUE(Tracker[ClosedDate])>SELECTEDDATE
||Tracker[ClosedDate]=""
)
--------------------
--Results
Return
countrows(rlvttable)
Anyone could advise me how to correct it? Thanks~
Check the data type of columns Tracker[ClosedDate] and Calender[FullDateAlternateKey] - one of them is Text, rather than Date.
To fix, you could:
choose a different field which is already a Date format
change the format of the offending column
use DATEVALUE in your measure, to convert the text date to a real date.
It also looks like you need to edit this statement, as these conditions conflict:
Tracker[ClosedDate]>SELECTEDDATE
&&Tracker[ClosedDate]=""
I am trying to compare the closedDate with "". I should use blank() instead.

How to calculate conflicting meeting using data from Exchange server in PowerBI

I am trying to get data insights of my calendar through visualizations in PowerBI. I am able to get almost all data from my outlook calendar using in-house API in PowerBI. I intend to find how many conflicting meetings I have per week, but I couldn't find any flag column for that. I'm trying to use time slicers to generate a what-if parameter to calculate a flag, but it doesn't work. Is there any way I can track conflicting meetings?
The data I have relative to meetings is as below -
You could add a Calculated Column to the dataset, with a formula like this:
Conflicting =
VAR StartDate = 'Calendar'[Start]
VAR EndDate = 'Calendar'[End]
VAR IDCurrent= 'Calendar'[Id]
RETURN
IF (
COUNTROWS(
FILTER (
ALL('Calendar');
'Calendar'[Start] < EndDate &&
'Calendar'[End] > StartDate &&
'Calendar'[Id] <> IDCurrent
)
) > 0; TRUE(); FALSE())
This formula checkes if there are different rows within the same date range.
You can adjust the date comparions based on your needs. I've got the logic from this post and removed the equal signs, to prevent contiguous items marked as overlapping.
The Id column is the Unique Identifier (like a unique, primairy key) automaticly provided by Exchange Online. The filter on Id <> IDCurrent makes sure you're not mark the current row as overlapping, e.g. it searches for all rows exept the current one.:
Result:
Edit: The formula above results in a true/false value. You can easily remove the if statement, to count the conflicting appointements, but remember that the value will be counted twice (or more); for each conflicting appointment.