How to filter with set analysis, sum and max, year and day - qliksense

I'm trying to show the mount from last day loaded in the database (Filtering by year and date).
It will be like this:
Sum({$<ANO_MES={'$(=Max(ANO_MES))'},[SH_historico_1.DIA_PAGO]={19}>}[SH_historico_1.MONTO]/1000000)
The "19" have to be with code automated, and not manually.
So if I put:
[SH_historico_1.DIA_PAGO]={MAX([SH_historico_1.DIA_PAGO])} instead "19"
It will not load. So, how can I filter correctly?
I can show last day loaded "19" but with MAX, like this:
Max({$<[SH_historico_1.ANOMES]={'$(=Max([SH_historico_1.ANOMES]))'}>}[SH_historico_1.DIA_PAGO])
Any ideas? Any help it's welcome, thanks!

Try to put like this so it will evaluate first
[SH_historico_1.DIA_PAGO]={$(=MAX([SH_historico_1.DIA_PAGO]))}
or for example:
[SH_historico_1.DIA_PAGO]={"=$(=MAX([SH_historico_1.DIA_PAGO])")}
if it doesn't help you can also create variable with
MAX([SH_historico_1.DIA_PAGO]
and then put that variable to set analysis

Related

create a dynamic title that displays date range as per the start and enddate parameters used

I have a report that displays monthly and ytd amounts. I use start and enddate parameters that change according to the user. For example for startdate 4/1/2007 and enddate 2/28/2008
1. I need to display title as Monthly budget 2/1/2008 to 2/28/2008
2. I need to display title for YTD as YTD 4/1/2007 to 2/28/2008
I tried = Parameter!EndDate.value but it throws error
It looks like you may have missed a letter in your expression. It should be:
=Parameters!EndDate.Value
In the expression editor you can double click on the parameter name and it will insert it into the expression for you.
To get the full description that you mentioned, you'll need to use a combination of functions. One useful one to look at is DateAdd to add days and months to the specified date. Another one is FormatDateTime which allows you to use the standard "ShortDate" format.
If you run into further trouble, I would recommend posting a new question with the variations of code that you tried along with the specific error messages that you received.
You could try setting the Expression for a text box to:
="Monthly Budget " & FORMAT(Paramters!StartDate.Value, "MM/dd/yyyy") & " to " & "FORMAT(Paramters!EndDate.Value, "MM/dd/yyyy")
This will give you:
Monthly Budget 02/01/2008 to 02/28/2008
It is the same for your second requirement, just change the wording.

How can I make a google sheets query for dates that fall in "this week"

I'm trying to put a query in one google sheet tab that pulls in data from another tab (Called Confirmed Shoots), based on one "date" column in the Confirmed Shoots tab. I want to pull in anything from the current week, probably taken from the week number (WEEKNUM).
I have a similar formula working in another tab where I'm pulling in everything scheduled for tomorrow, which is:
=query('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D Where G=date"""&text(TODAY()+1,"yyyy-mm-dd")&""" ")
I also found a way to pull "this week" from a date with this IF formula-
=IF(WEEKNUM(G2)=WEEKNUM(NOW()),"Yes","")
I'm struggling with the syntax, trying to combine the two. I want it to be something like:
=query('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D Where (WEEKNUM(G2)=WEEKNUM(NOW()),"yyyy-mm-dd")&""" ")")
or
=query('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D Where (WEEKNUM(G2)=WEEKNUM(NOW())
Both of these are giving me errors though. Does anyone know how to do this? Thanks!
Try:
=FILTER(QUERY('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D"), WEEKNUM('Confirmed Shoots'!G1:G)=WEEKNUM(NOW()))

DATEDIF statement in SharePoint not working properly

I am trying to calculate the amount of days between two dates but my formula doesn't seem to be working properly. It's as is the function is ignoring the years in the dates. My function is as follows:
=IF([Today's date]>[Expiration Date],-DATEDIF([Expiration Date],[Today's date],"d"),(DATEDIF([Today's date],[Expiration Date],"d")))
I receive this error if I use the above function(Owners removed):
But then I replace -DATEDIF([Expiration Date],[Today's date],"d") with -DATEDIF([Today's date],[Expiration Date]"d") i get this result:
This is telling me that both cases are being treated as IF([Today's date]>[Expiration Date] even though 3/24/2015 is clearly larger than 11/03/2014. Can somebody please tell me what I'm doing wrong? Thanks.
=[ExpirationDate] - [TodaysDate]

How to get the last day of the current month in DataStage?

I have explored all the functions avialable in the trasformer, but could not found the exact function to get the last day of current month by passing date in same default format i.e. yyyy-mm-dd.Please help me in this regard.
Field("31|28|31|30|31|30|31|31|30|31|30|31", "|", MonthFromDate(InLink.dateVar))
It is more precise to establish the first day of next month then use DateFromDaysSince function to establish the day before. I created an integer(6) stage variable which contained century and month+1 from source link e.g. 201410
DateFromDaysSince(-1, StringToDate(svIHBKPR, "%yyyy%mm") : "%yyyy-%mm-%dd")
There is a transformer function called DaysInMonth.
Example: DaysInMonth(“2017-01-23”)= 31

Looking for Function or tips to extract Image Access Date and time in matlab

I have an array of images in an folder,and i would like to read them in the order they copied in the folder i.e. for example there are three images if 1st image copied at 7.15 PM second at 7.45PM and third 7.55PM, i would like to read image which copied first in my folder in terms of time and date.? so how to sort image in that order? have any idea.
On the other hand,if right click on any image,and go to proporties,you will find three types of date i.e. Created date and time, modified date and time and access date and time. i would like to extract the access date and time of any image in matlab? how to do that? pls guide.
I am not sure if there is a way to find the atime with a MATLAB function, you might have to do a system call. On most unix-like systems it would look something like this.
>> [status result] = system('ls -trlu')
I don't know if it's possible to get the "access" date, but you can get the "modified" date with the dir function. By doing:
d = dir('directory');
time = d.date;
You then need to extract the relevant information from the string output of d.date and sort it accordingly.