adding date range to custom attribute magento - magento

Is there any way to add a date range to a custom attribute (similar to that used for special prices and the "new" status of product) in magento? For example, I have a custom flag which tracks the status of a product. It would make it a lot easier if I could use a date range to set/unset that field.
(For example, when a product is marked as "coming soon" I add a tag to its image, which I manually unset once I make the product "new". Annoying to have to do it manually)

You will have to create 2 attributes that hold 2 dates. Them being:
New From: (Date Value)
New To: (Date Value)
Then, you will have to go into the file where you want the attribute to display, check to see if the date is within the range of today's date.

Related

Is there a way to add the current date in AWS QuickSight dashboard's title/description?

I would like to add current date (or latest reload time) in AWS QuickSight dashboard's title/description, is there a way to add the formula to text bar?
It could be added to the description by creating a date parameter and assigning a dynamic default which gives today's date. Then you can add the parameter as follows <<$ParameterName>> to the description and it should show its value which would be today's date.
A dashboard's title is only set when the dashboard is created so you cannot change that (unless you publish a new dashboard daily)
It can be done using calculated fields. basically create calculated filed which will give you same current date for all your rows and you can use that field in insight visual by customizing narrative.

Google sheet adding a layer on top of a vlookup to make it conditional on a yes/no and a date

I would like to put in a basic toggle into a Google sheet.
Here is my reference table, It gets imported from another Google document so it's updated all the time.
I also have another google sheet that goes back to this lookup reference. It fills in the data if the date is less than today's date and matches the Date and the Source columns as a key.
I'd like to add another part in the Google sheet that says Include Today and you can type in the word "Yes"
If you type in Yes, I would like the yellow section, that uses the lookup_ref reference table, to include today's date, and otherwise include only days before today. In the example here, today is October 14, so if we type in "Yes" into this field, we need to have a value other than 0 for V15.
Okay, so you want to optionally include today's values in the formula. So you can conditionally add 1 day to today based on the value of "Include Today".
For example, if you add "Include Today" Yes/No value at cell "Z1", then you need to add IF(Z1="yes",1,0). So your formula can be
=IFERROR(IF(O15 < today() + IF(Z1="yes",1,0), vlookup(A15,lookup_ref,4,false), 0),0)

Quicksight parse date into month

Maybe I missed it but I'm attempting to create a dynamic 'Month' parameter based on a datetime field - but can't seem to get just the month! ? Am I missing something ?
here's my source DTTM date/time field -
In Manage Data > Edit [selected] Data Set > Data source
Just add 'calculated field':
truncDate('MM', date)
where MM returns the month portion of the date.
See manual of truncDate function
The only place in Quicksight that you can get just a month, e.g. "September" is on a date-based axis of a visual. To do so, click the dropdown arrow next to the field name in the fields list, select "Format: (date)" then "More Formatting Options..." then "Custom" and enter MMMM in the Custom format input box.
Quicksight menu selection as described
This will then show the full month name on the date axis in your visual. NB It will use the full month name on this visual for ALL time period "Aggregations" - e.g. if you change the visual to aggregate by Quarter, it will display the full name of the quarter's first month etc.
If you are talking about "Parameters" in the Quicksight analysis view then you can only create a "Datetime" formatted parameter and then only use the "Date picker" box format for this parameter in a control (+ filter).
If you use a calculated field in either data preparation or analysis view the only date functions do not allow full month names as an output, you can get the month number as an integer or one of the allowed date formats here:
https://docs.aws.amazon.com/quicksight/latest/user/data-source-limits.html#supported-date-formats
You'll need to hardcode the desired results using ifelse, min, and extract.
Extract will pull out the month as an integer. Quicksight has a desire to beginning summing integers, so we'll put MIN in place to prevent that.
ifelse(min(extract('MM',Date)) = 1,'January',min(extract('MM',Date)) = 2,'February',min(extract('MM',Date)) = 3,'March',min(extract('MM',Date)) = 4,'April',min(extract('MM',Date)) = 5,'May',min(extract('MM',Date)) = 6,'June',min(extract('MM',Date)) = 7,'July',min(extract('MM',Date)) = 8,'August',min(extract('MM',Date)) = 9,'September',min(extract('MM',Date)) = 10,'October',min(extract('MM',Date)) = 11,'November',min(extract('MM',Date)) = 12,'December','Error')
Also, I apologize if this misses the mark. I'm not able to see the screeshot you posted due to security controls here at the office.
You can use the extract function. Works like this:
event_timestamp Nov 9, 2021
extract('MM', event_timestamp)
11
You can add a calculated field using the extract function:
extract returns a specified portion of a date value. Requesting a time-related portion of a date that doesn't contain time information returns 0.
extract('MM', date_field)

Magento update with csv and unset special price

I'm trying to update a product in Magento through Import/Export -> Import, using a .csv file. I'm passing just _sku, _type, _attribute_set, _store, price and special_price columns. I want to unset the current special price of the product, but when I pass an empty string it sets the special price to 0. I tried with null, "NULL" and "<NULL>" but the result is the same. When the value is 0 it is still shown as special price on the front end, which is really confusing. That's why I want to set it to null, as this is the value it receives when it's being removed from the admin.
My goal is the equivalent of this:
$product = Mage::getModel('catalog/product')->load(some_id);
$product->setSpecialPrice('');
$product->save();
Any ideas?
I just realized that setting the special price a value that is equal to the value of the regular price will do the job. Then the template for the special price will not be used on the front end. I hope it will not bring some other issues, but for now it works for me.
You cant remove it with a regular csv import. Your best bet would be to add coloumn;
special_to_date
and set a date in the past in this format;
31/10/2014 00:00
This will expire your special price.

Excel Pivot Table - Date Range Filter with Filter Dimension

I have a date dimension in the FILTERS part of an Excel 2013 Pivot Table.
I want to easily filter for all the dates in a range but i have to check and uncheck tons of checkboxes while i would like to just specify two dates. I can do this when the dimension is in the ROWS but i can't understand how to do the same in filters.
Have you considered using a Timeline filter instead of a regular filter or slicer?
You just need to have a field that is a date. Use it to create the timeline (on the Insert tab in Excel, choose Timeline). Then you can select the level/time period (date, month, quarter, year) at which you want to create your date range and click and drag to create the range. More details are in the link.

Resources