get name of current SmartVariant - sapui5

What is the name of the currently selected Variant in a smartFilterBar?
In the event 'afterVariantLoad' of the smartFilterBar the ID of the selected Variant can be retrieved with: oEvent.getSource().getSmartVariant().lastSelectedVariantKey. But the ID is generated and not useful for the actual usecase.
How to get the Name and content of the variant from there?
UseCase:
On a specific Variant a DateRangePicker should always select a range of 13 Months starting with January of July, whatever comes first.

You can get all the available variants
oEvent.getSource().getSmartVariant().getVariantItems();
and find the variant content by filtering the key.
oEvent.getSource().getSmartVariant().getSelectionKey();

Related

Acumatica REST API Filter on last modified date

I'm looking to create an integration and need to be able to extract data based on last modified date. I have followed the example provided (Acumatica StockItem example) but the Get always returns all stockitems.
I have modified one stockitem and since the filter in the example is for modified dates greater than a month ago this stockitem should be only one being returned.
Looking at the Content returned the issue would appear to be a "unrecognized" date format, but I have followed the example.
It would appear I'm missing something here but can't figure out what, any advise?
Screen Capture of returned Content
JSON view of StockItem data being returned, modified item CONTABLE1 shows LastModified date of 2021-01-05
You are passing the value in the wrong format. You need to replace all the special codes like %3A and %2B with corresponding characters.
%3A is :
%2B is -
The below request is working without any issues.
http://localhost/ACU20193/entity/Default/20.200.001/StockItem?$top=5&$filter=LastModified gt datetimeoffset'2021-01-02T00:58:57.837-08:00'

Query on Tableau Dashboard

I am a new to Tableau and having some issues with it.I am Using a parameter to filter month data across Sheets connected to different Data Sources.
I want to Filter Current Month Data Automatically when the dashboard starts.
Can anyone guide me on how to do it.
Thanks in Advance.
T
Introduced in version 10.3 is a feature called Latest date preset. The release notes say "Start with up-to-date data. Set filters to display latest date values automatically, as soon as your workbook opens." Create a filter that spans applies across the data sources and use this new setting. The setting is in the filter dialog.
See https://www.tableau.com/new-features/10.3#tab-analytics-2
The critical aspect of your question is that you are filtering multiple data sources using a parameter. Given that, the most straightforward approach is to define a boolean calculated field in each data source, called say Within_Date_Range.
Each of those calculated fields should compare the appropriate Date field in that data source to the selected parameter value and return true or false to indicate whether the current record should be included in the query. (Parameters are scoped to the workbook and visible from all data sources)
Place the [Within_Date_Range] field for data source X on the filter shelf for the worksheets that use that data source X. Check the true box of course.
Now when you change the parameter, all the worksheets filter accordingly.
Alternatively, you can abandon the use of a parameter. Define relationships between your data sources using the corresponding Date fields (under the data menu). Show a filter control for the date field for one of the worksheets and set the scope to "related data sources"
Hope this helps!
Create a calculated field Date_Filter as
lookup(min([Your_Date_Field]),0)
Drag this to 'Filter'; select 'relative date' option and choose last 1
month (because you wanted to show just the current month data by default).
Right click this filter and select "Apply to selected worksheet" and
choose sheets in which you want this filter to be applied on the
dashboard.Viola!
With this solution you can very well see current month's data by default and can go back to as many time periods you want.

Drupal 8 contextual filter for date

does anybody know how to implement the view with contextual filter on date/time value? I have a content type Event with date field within it and need to somehow filter items within specific month. Not sure if it can even be done without special programming and if so, whether via that contextual filter (like node/) or maybe via exposed filter with list of months so user can filter items by himself??
Thanks
TC
There exists the contextual range filter module.
https://www.drupal.org/project/contextual_range_filter
To the time I am writing no Drupal 8 version is shown on the module page, but there are some. Have a look in the release section "View all releases". There you can filter the API version "8.x".
You can have a look into the README.txt for all the possibilities to query.
http://cgit.drupalcode.org/contextual_range_filter/plain/README.txt?id=refs/heads/8.x-1.x
A simpler solution could be to use the build in function in views
You can add special fields in the contextual filters section
They are called:
Created year
Created year + month
Created week
Created month
Created day
Created date

Excel - Insert "day" on a cell and format it to date with current month and year

I am working on a home accounting template (and could not find any good one :-/), so I am creating one for each month. Both in my expenses and my incomes, I would like to have a date column where I just have to insert the "day" (e.g.: 22) and it automatically fills the rest with the current month and year (or I could set them in another cell).
For example: 22 + ENTER would return: 22/12/2014
If I do this, I automatically get a default date: 22/01/1900
I do not know if it is possible to change this defaul date depending on the current one or any other value.
I have tried with a different strategy: if the amount column is not empty, fill in with today's date: =IF(A3="";"";TODAY())
The problem is that I do not always register today's expenses, so I need to change it manually. I was just wondering if this is possible and there is a better way (maybe a macro?).
You need Excel to modify the cell contents after you press ENTER. The only option seems to be a Macro using the Worksheet_Change event.
Please check out this other question. I think that will help.
This can be achieved with simple formatting and use of controls that are available in Excel. VBA will give you drastically more flexibility, however the request above can be accomplished without learning VBA.
I have included a sample file here.
Steps to recreate:
Create a range of months. I created a range including the current month through 12/2014
Insert a combo box from the developer tab. Right click and select Format Control. On the Control tab, input the range you just created and then select a "linked cell". This will insert an integer to indicate which item you picked in the list, starting at 1.
Use the attached formula to add the DAY that you enter in the first column and VLOOKUP the month and year from the value chosen in the combo box.
Enhancements: I used conditional formatting to change the text color of the days you enter to WHITE. This way you won't see them. I also included some checking in the VLOOKUP formula: the day you enter must be a number and must be non-blank for a date to populate.

Drupal 7: Filter view if date field has end date

I have the following situation in Drupal 7: I have a content type "documents" which contains a field validity which is a Date field that is mandatory. It may contain an end date, but it also may not. (Single Date field that allows setting an end date.)
The meaning of this field is that if the end date is set, the document is valid only until this end date (which may be in the past or the future). If there is no end date set, the document is valid until further notice.
Now I want to create a view that filters all documents which are still valid. So the first filter I create is that the field_validity value is in the past. Now I need a filter that checks if either the end date is not set or is in the future. But in the database, the end date is set to the same date as the starting date, when it is not selected in the specific entity.
Any ideas how I can archive this?
Regards,
Christoph
Have you tried a PHP views filter? https://drupal.org/project/views_php
It allows you to create a Views filter which executes custom PHP code, so you can have full control over your condition.
The module only exists in a DEV version, but is widely used with 38,000 active installations.
Otherwise, if I understand correctly, you only want to show documents that are between field_validity and end date.
One option would be to problematically set your end date to something obscene (100 years later), if the value is blank. This way your view will be simple to create.