Drupal JSONAPI date range date range - drupal

I followed the documentation on filtering.
Used the following code in order to fetch date range data.
&filter[datefilter][condition][path]=field_date&filter[datefilter][condition][operator]=>=&filter[datefilter][condition][value]=${fiscal_year_start}&filter[datefilter][condition][path]=field_date&filter[datefilter][condition][operator]=<=&filter[datefilter][condition][value]=${fiscal_year_end}
It fetches the second filter condition only. It would be great if anyone can help me with this issue.

It was solved once I change the second condition filter name [datefilter] to a different name.

Related

Google Data Studio filter combining two custom fields

I am trying to join data associated with two custom variables in the same Google Analytics dataset for a filter widget. We have institution names for older data in customVarValue2 and after GA changed the use of custom variables, newer data in Institution. I would like to be able to access all that data (back to October 2011) in one pageview chart and I think I can do that with a calculated field.
I saw on a post in the Data Studio forums that the logical operators don't work so I've been trying to do this with individual lines like so:
CASE
WHEN REGEXP_MATCH(customVarValue2, '.*Denmark.*') THEN 'Denmark!'
WHEN REGEXP_MATCH(Institution, '.*Denmark.*') THEN 'Denmark!'
ELSE 'Other'
END
The goal is to end up with one "Denmark!" field in the widget dropdown where all the data is combined from the two custom fields (customVarValue2 and Institution) to cover the whole date range. I can get it to work with one of the variables and it gives me the choice of "Denmark!" and "Other" with the appropriate date range for the custom variables that I used. But when I put both "WHEN" cases in, I only get "Other" showing in the widget dropdown. I would appreciate any advice you can give.
Thanks,
Sandy
The version below seems to work for me on a different case. Have you checked the case of the custom variable macthes?
CASE
WHEN REGEXP_MATCH(customVarValue2, '.Denmark.') OR REGEXP_MATCH(Institution, '.Denmark.') THEN 'Denmark!'
ELSE 'Other'
END

Akeneo: Get attributes from a Variant group

I want to check if some attribute values have changed after editing a Variant group in Akeneo V. 1.3.
Unfortunately I am a little bit lost: Is there a way to get from a Pim\Bundle\CatalogBundle\Entity\Group to the attribute values? Is there another better way to get these values of a Variant group that was edited?
I cannot even find out in which table the attribute values are stored in MySQL (I've just found pim_catalog_product_value for the product values).
Yes, it's not easy to dig into this part.
The values of a variant group are not stored in the same way than the products values.
These variant group values are only used to be copied in related products and are stored in a product template.
From a product template, you can fetch the values normalized in json with
$group->getProductTemplate()->getValuesData()`.
You can take a look on ProductTemplateApplier and ProductTemplateUpdater to see how we apply variant group values on products (json format is useable almost directly with product updater).
When we edit a variant group, to be able to use the same form than for the product, we use a subscriber TransformProductTemplateValuesSubscriber.
It denormalizes json values to product values objects with
$this->denormalizer->denormalize($data->getValuesData(), 'ProductValue[]', 'json');`
Don't hesitate if you need any further information.

How to list unique values of a particular field in Kibana

I am having a field named rpc in my elasticsearch database and I am displaying it using Kibana. When I search in search bar of kibana like:
rpc:*
It display all the values of rpc field but I want to have only those value to be displayed which are unique.
I have been playing around with Kibana4 since a couple of weeks now. I find it intuitive and simple and the experience has been great till now. Following your question, I tried getting unique results via a Data Table visualization. Why? Because I personally find it easier to understand. Following are the steps:
1. Get unique count
Create the visualization (Visualize -> Data Table). First lets get
the count of how many unique entries we have for a particular field
(We will use this in the later part for verification). I'm using
clientip.raw but as I see, it will work just fine with any friendly
field name too.
2. Set the aggregation right
Set you aggregation back to count and have a Split Rows as follows. Not doing this will give you count 1 for each field value (since it is looking for unique counts) when you populate the table. Noteworthy part is setting the Top field to 0. Because Kibana won't let you enter anything else than a digit (Obviously!). This was the tricky part. Hit Apply and you'll get the results. Unique field values and the count of each of them.
3. Verification:
Going to the last page of the table, we see there are exactly 543 results. This is how I know it works.
What Next?
You save this visualization and add it to a Dashboard. There you can always check the request, query, response and other stats.
Just an addition to the above mathakoot answer.
For the user of newer version (which do not allow bucket size of 0 anymore) just set a value greater than the maximum number of result
And report the value in the Options>Per Page field
I am using Kibana 6 so the UI looks a bit different than the older answers here.
Here is what worked for me
Create a visualization from your query, I used a line graph type (don't think it matters)
Under Data, set metrics aggregation = "Unique Count" and set field to your field.
Set x-axis aggregation = "Terms" and set field to your field.
Set Size > your number of records
Under Metrics and Axes, disable drawing of the graph, circles, and labels (this really helps the UI not lag)
Run query and then click "Inspect" and download CSV
Data
Metrics & Axes
I wanted to achieve something similar but I'm stuck with Kibana 3.1.
I simply added a panel of type "TERMS" and configured its Field = User-agent and left everything else on default values. This gave me a nice bar chart with one bar for each User-agent.

Reporting Services Sorting by Date issue with TFS Report

Long time reader etc,
I've a TFS report that I want to alter the sorting on by date. The problem is the sort only seems to consider the day element and the rest isn't considered. For example, the following is happening:
1/7/2011
1/7/2011
1/7/2011
2/12/2010
3/03/2011
3/03/2011
I've looked for a way to specify the datatype on the box in the table but to no avail. Any suggestions?
I've realised the field was being treated as text as the date in question isn't guaranteed to be there and replaced with an empty string if it wasn't.
Two steps have fixed the problem:
Added calculated field to dataset and wrapped an iif around to deal with missing dates as being way off in the future.
=CDate(IIf(IsDate(Fields!My_Date.Value), Fields!My_Date.Value, DateAdd(DateInterval.Year, 10,Now)))
This then forces the field to be treated as a date. I then added a sort on the group on this calculated field which isn't shown in the report and gives the impression that those items with a date get ordered and the rest are left to the other layers of sorting which is correct.
Is there a better way of doing this?
I find it a very efficient way!
I did it myself more complex
Group properties of the field you want to sort on
Sorting
expression:
=Datepart("yyyy",Fields!Datum.Value) & Datepart("m",Fields!Datum.Value) & Datepart("d",Fields!Datum.Value)
It will sort first on year, then on month, then on day

Setting report to current date

I have a report where it shows meetings and their requirements. However i just want the report to show ONLY today's stuff--not the entire week's worth.
I tried setting my group header (i'm grouping by day) to currentdate but yet it still shows me the entire week. I then have to go to the grouping tree and select today's date. Is there any way to run my report and have it ONLY show today's stuff and nothing else???
Any ideas?
Use the select expert to limit the results to today's date. printdate is a special Crystal Formula keyword.
{table.date_field} = printdate
Or, if you're working with a datetime db field you can strip the time with CDate
CDate({table.date_field}) = printdate
One way would be to change your query so that it's only getting one day's worth of data; that is, assuming your data contains a date field. To take it a step further, you could add date parameters to the query itself and leave the group headers as is. That way, you can have one day of data, or data from a specific date range.
If you have no influence (or desire) to change the way data comes into Crystal Reports, you could also add a formula via the Section Expert to suppress the group or detail section unless the date is the current date.

Resources