Calculated Field- Sharepoint 2010 - Ageing - list

Again a calculated field question, How can I create a calculated field to find out, what is the age of the entry.
In the list I will have a created date field, from that I would like to create a number field calculating the no of days from created day to today. I tried with =Today-Created, not working!!
Any inputs ? Thanks !!

Use the DATEDIF function:
=DATEDIF(Created,Today,"D")
UPDATE:
Because Today won't work (see comments below), the OP chose a completely different approach using XsltListViewWebPart.

Related

Dynamics Ax EDT Filter

Hi I'm sorry for my English
I made an EDT that relation with table field and use EDT on StringEdit for make lookup.
Here is my problem. When I use EDT on StringEdit All records coming into but i want to get only 'CostCenter' valued ones
If CostCenter is an enum value, then you could resolved this with a conditional table relation. Documentation for these relations can be found here.
When this is not the case you can provide a custom lookup for the form field. An example is also available in the documentation, see this page.
If the proble is that you dont want to see more than one specific colum in the table you could modify the autolookup group in the table.

QuerySet with Avg

I'm having problems making a queryset for a report :/
The ChangeLog model (please see model picture below) stores every change in MedicalRequest model. I'm trying to get the time average from first record to last record in ChangeLog for a single MedicalRequest. I'm querying from customer because I'need make some reports.
I already test this:
customer = Customer.objects.get(pk=10)
customer.medicalrequest_set.aggregate(avg=Avg(Max(changelog__timestamp),
Min(changelog__timestamp)))
but I'm getting 'changelog__timestamp' is not defined :(
any idea?
Your problem is with your syntax. changelog__timestamp is treated as a variable, which you haven't defined. You have to pass the name as a string to these functions. Like, Max('changelog__timestamp').

POWERBI: take while table when there is no available relation

I have a slight issue with my tables in POWERBI. In short, I have a missing link in one of my relations. As a result, instead of returning NOTHING which is logical and actually what I would like, it returns EVERYTHING.
A bit more details, I have the multiple tables with relations between them. The problem is that I have a few task_group pointing toward shipments that do not exist. In my visualization, I am trying to access data (a count of the number of Packages linked to a shipment) that is linked to a shipment. The logical thing for me would be that "If there is no shipment fitting the number that is given in the shipment table, then you cannot count the number of packages linked to that shipment".
But PowerBI beg to differ. His idea is "If I cannot find a shipment to link to package, i'm going to take every single package regardless of shipment". As a result, a group of task that do not have any package end up showing as having all the packages instead. How can I tell powerbi to return nothing if he doesn't find anything instead of returning everything?
Image of my relationships
I think Power BI behaves slightly unintuitively where there are nulls on one side of a join.
Have you tried filtering to only include where shipment_id is not blank?
If the problem is you having NULLs in one side of the relationship, the best way to tackle this would be to replace the NULLs with something else. Now, you can do it in two ways:
Edit the Shipment number NULLs to something else in the Power query while importing (Some number which is not likely to be an actual shipment, maybe 0)
Create a calculated field in DAX replacing the blanks/NULLs and use that in the relationship instead
But I think you may have NULLs in both the sides of the relationship. That is the only explanation I can think of, why Power BI is behaving this way. Either way, the above solutions should fix it.

Missing values in PowerBI slicer

I have a problem in my cube with a dimension value as a slicer or a filter. It has no and name and I want to slice on name, but some of the values are missing. It is the same problem if I use no. If I use no as a filter and use advanced filter to search for the specific no the data works, but the slicer for name is still empty. The strange thing is that I can see the no and name fine in the data area, just not in the filter or if I use a slicer.
I have the same problem in PowerBI desktop and in the online version.
Edited:
I have several facts using the same dimensions. I have found that a disabling a specific relationship from a fact one of the dimensions makes the problem disappear. The number of values in the slicer are a bit too many, but at least now it doesn't exclude some of the values I can see. The only problem is that I need the relationship. I have checked if there should be a problem with the values for the relationship such as missing or null values, all the values are there.
My colleague found the solution for my dashboard: when you go to the options of the X axis there is a Start and End box. In my End box there was a number, which caused the last value to disappear. When I removed this number (and Auto appeared), my graph was complete again.
Removing and adding the problematic fact table again solved the problem.
It was quite hard to find out what was causing the problem to begin with. I went about it by first creating a minimal cube to make sure that the core data was correct. After verifying that, I opened the problematic cube and starting removing facts and dimensions until the problem disappeared.

Ember complex property bindings

I am using quite complex property bindings to be able to change either day, month or year of a user's birthdate. Having an attr birthDate of type date on a user and three properties for each piece of the date.
I am using moment.js to simplify date manipulations.
By trying the reduced showcase on jsfiddle you'll see that if you change year or day, the month is always increased by 1. I can't say what is happening. Just this: when setting the new date, the value is correct and gets changed later. Is there an issue with ember-data date attributes and some formating?
Again: here's the jsfiddle - written in CoffeeScript.
Thanks in advance!
I looked at your code and it looked like it should be working fine, the more I stepped through it the more I got annoyed that I couldn't spot the problem ... turns out it's the .month() method from Moment.js ... from the docs:
"Mutates the original moment by changing the month. Accepts numbers from 0 to 11"
Pretty dumb huh? In any case change your setMonth to subtract 1 from the value when you use .month()
setMonth: (property, value) ->
#set property, moment(#get(property)).month(value-1).format()
return value