use one column 'plan_start_date' in listing..
use two database table('plan','plan_renewal') for fetching data in 'plan_start_date' column..
if start date found in 'plan_renewal' table, then show start date from 'plan_renewal', otherwise show start date from 'plan' table..
when sorting these data 'desc/asc' facing some issues..
it only sort data (start date) according to plan table only..
how can sort date according both table's data(in acs or desc order) ??
thanks in advance..
Related
I want to make the following table with such data:
Columns: Dates from the selected week(based on calendar table) in WeekMonth slicer
Subcon: Subcontractor distinct list, created with power query from the Subcontractor values in the data table
Plan and Actual: count of set dates, which were set in the data table which looks like:
siteid, subcontractor, milestone, plan date, actual date
Milestone slicer allows to filter data table for a specific milestone and is linked to datatable[milestone]
WeekMonth slicer allows to filter data table for a specific week, only one week can be displayed in the table, by default the "current week is selected".
Filtering data table using the Relatationships between the Calendar[WeekMonth] and the data table is not possible because it contains two types of dates.
As I understand the DAX measures for Plan and Actual must be designed in a such way so it would refer to the date from the matrix Column. How this can be implemented?
How the table must look like(values are not correct yet!):
"Filtering data table using the Relatationships between the
Calendar[WeekMonth] and the data table is not possible because it
contains two types of dates."
It is actually possible to filter multiple date fields by one calendar table in Power BI.
The way it works:
Connect your Calendar table to plan date field;
Connect the same Calendar table to actual date field. Power BI will add this second relationship as "inactive", as indicated by the dotted line;
Normally, when you use your week slicer, it will filter DAX measures by the active connection only (plan date). However, you can tell DAX to filter by the inactive connection instead, using USERELASHIONSHIP function.
Code typically looks like this:
Metric by Plan Date = SUM(TableName[Field])
Metric by Active Date =
CALCULATE( [Metric by Plan Date], USERELASHIONSHIP(Calendar[Date], TableName[Actual Date])
Here, you first define your DAX measure normally, and it will calculate using Plan Date. Then, you recalculate the same measure using different relations (Active Date).
This article might help you further:
https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi
I am trying to sort months into PowerBI Designer Preview, it looks like it only can be done alphabetically. But when I look on the internet at images of PowerBI it looks like they are all sorted correctly. Can somebody help me? And there must be other people who are facing this problem right?
Thank you in advance.
Check what is the data type of the column you are trying to sort. If it's Text then it would sort alphabetically, irrespective that these are numbers. Make sure it's Date or Number to sort correctly.
In Power Pivot, you can set a sort by column. This hints Power Pivot to sort a given column like a column of month names by another column like a column of integers representing the order of month names. The pattern is to create a Date table - a table with all of your dates. In this date table you create a column with month names and another column with month indexes. Then you select the column with month names and set the sort by property to the month indexes column. Usually, I like to create a 'MonthYear' column that has values like "Dec-14", "Jan-15" etc. this then allows me to sort correctly across years.
So I have a table which consist of Date, Time Start, Time End, Client.
How can I sort the table in a way such that it orders by Date ASC and then looks into Time Start ASC.
I tried adding these 2 lines in actionAdmin of the controller.php:
$model->dbCriteria->order='date ASC'
$model->dbCriteria->order='timeStart ASC
But it will ignore the Date sort and goes directly into timeStart sorting.
How can I do it so that it takes both into account? Please advise, thanks.
CDbCriteria does not provide multi-sort feature. If you need to have multi-sort, you should use other third-party plugins such as jqGrid.
I want to build sync method, both from my local database to parse.com and from parse.com to my local database. For first case ( from local to parse.com, Alhamdulillah my script run well. But for second case, i need query between column last_update and last_sync (i do not use updatedAt caused by i can't control it, so i use last_update).
Please explain me how to get all data if last_update is greaterThan last_sync?
From https://www.parse.com/questions/querying-between-two-dates i got query between two dates, but it's from same column, the value of query is real value. But my case, the value of key = last_update is column name, last_sync.
Thank you...
You can't use a query constraint that compares two columns. You need to change your logic. Why do you store both a last_update and last_sync in a record?
Syncing is a complex subject and you can easily mess up the logic. I don't understand how you can store a last_sync date on every record, as this has to be different for every user. You need to store the last_sync value for each user, and use that to compare against the last_update column on all records.
I have this table
training_schedules
id
course_reference
start_date(date)
end_date(date)
year_id(int, fk)
on my form, I have dropdownlist for the month, and another one for the year.
Now as you can see there is a mismatch on the month from form and database column. How can I filter the start_date or end_date column using only the integer value from the dropdownlist and ignore the day and year part of the db column?
I saw some examples but using raw query and using date functions of database which is not good if you consider performance because it is not indexable.
Can I achieve this using Eloquent/Fluent Api of Laravel?
If you are using mysql
u can use the month() function to get month from date
For further clarification please visit the link