In webdatarocks pivot table, how can i get the date to be split into Year / Month / Day by local time? - webdatarocks

The date for the entry below will be split by the pivot table to 2022, June, 30 but I need it to be 2022 July 1 when viewed in UTC+10. How can this be achieved without fudging (time shifting) the input date field?
{
"name": "Fred",
"duration": 33.2,
"date": "2022-06-30T23:55:50.298Z"
}

The recommended way of displaying the date in your timezone is preprocessing data before passing it to the pivot table by removing Z from the date value.

Related

AWS-quicksight: Migrate SAMEPERIODLASTYEAR from PowerbI

I'm working with amazon-quicksight and I'm trying to migrate one funcionality from PowerBi to Quicksight but it has not been possible.
The idea is: I have a dataset with two columns "date" and "sales". The user will have a filter with the column "date". More than one date can be selected. Depending on the dates selected by the user we need to get two KPIs, the first one is the sum of sales for those dates (this is already done), but the second one is my problem, it should be the sum of the sales on the same days selected by the user but in the previous year (it depends on which year was selected for each date).
Example:
DataSet:
DATE
SALES
2020-01-05
1
2020-02-01
1
2020-06-10
4
2020-06-17
1
2021-01-01
1
2021-02-01
3
2021-06-10
3
2021-06-15
5
If the user select the dates: 2021-02-01, 2021-06-10 and 2021-06-15, the result should be:
KPI 1: Sum of sales (for those dates): 11
KPI 2: Sum of sales for those dates in the previous year: 5 -> (Days to use 2020-02-01, 2020-06-10 and 2020-06-15)
Do you have any idea about how can I calculate the KPI 2? Any suggestion?
In powerBI this (KPI 2) was done with the function: SAMEPERIODLASTYEAR
Thanks in advance.
I was able to solve this issue taking into account that the user must filter data from the two years, for example 2020 and 2021.
After that, I created the "calculated field":
calc_sum_sales = sum(sales)
After that:
calc_sum_sales_last_year = ({calc_sum_sales}-periodOverPeriodDifference(sum(sales),date,YEAR,1))
After that, I created an "visual table" and added in "group by" the field "date" and in "value" the field "calc_sum_sales_last_year"
I must give click in the column date to agroup by "year". In that way I get just two rows, one row for each year.
Finally, I change the "visual table" to "KPI" and I got the expected result.

Quicksight data import/upload skipping Empty DATE even though i gave 0000-00-00 00:00:00

Am uploading an CSV to quicksight
Eq data:
id Name Date
1 ABCD 2021-06-10 00:12:00
2 QAZX 0000-00-00 00:00:00 ----> This row don't have Date, so filled dummy date as specified in quicksight troubleshooting
The rows with default date format are being skipped.
any inputs will solve my issue are appriciated.
Thanks
You can add a filter on your visual representation. The filter should be applied to your "Date" column with the following properties:
Drop down 1: Date & time Range
Drop down 2: After
Time granularity: Day
Date: 1000-01-01
Visually, it looks like this:

How can you add a static filter criteria along with a user selected criteria to filter a table in Power BI?

I have a filter visual on my dashboard with dates that controls a table. What I'm looking for is if the user selects any date from the filter visual, I want the table to show data from the selected date AND a static date that I define say Dec 31, 2020. So, no matter what date the user selects, the table will always show data from Dec 31, 2020 and the selected date.
Is this possible?
Try this
Single Select = IF(HASONEFILTER(ValueTable[TransDate]), SUM(ValueTable[Value]),0)+ CALCULATE( SUM(ValueTable[Value]), ValueTable[TransDate]=DATE(2020,12,31))
Multi Select = IF(ISFILTERED(ValueTable[TransDate]), SUM(ValueTable[Value]),0)+ CALCULATE( SUM(ValueTable[Value]), ValueTable[TransDate]=DATE(2020,12,31))

Filter table by another table based on date field

I have a detail table in my model with a row for every hour in a day and the sales amount generated to that point of the date. Its not displayed on my report, rather it acts as the base for another reference table in the model:
Datetime Sales
2019-11-10 06:00:00 100.00
2019-11-10 12:00:00 200.00
2019-11-10 18:00:00 500.00
2019-11-10 23:59:59 999.00
The first (reference) table in the model only displays in my report the last hour value of each day in my base table. they are related via the datetime field using a 1:M with a single cross filter setting:
let
Source = Base,
#"Filtered Rows" = Table.SelectRows(Source, each ([Datetime] = #time(23, 59, 59)))
in
#"Filtered Rows"
Datetime Sales
2019-11-10 23:59:59 999.00
2019-11-11 23:59:59 950.00
2019-11-12 23:59:59 900.00
I would like to place a third table on my report that shows each of the hourly rows from the base table when a user clicks on a row in the daily table with the default setting being today's data which is added hourly.
I went down the path of using Power Query to try and filter the base table but have not been able to make it work. Should this instead be done using DAX? Either way, what would the query look like?
thanks in advance!
Thanks, but I have just resolved this. By changing my relationship to use a date field instead of the datetime field, and changing it to a (*:1) type, i am now getting the filter to do what I want. Now just have to figure out how to default to today's date. Thanks again!

PL/SQL weekly Aggregation Logic with dynamic time range

I need to aggregate the values at weekly interval. My date range is dynamic means i can give any start date and end date. Every sunday should be the starting week of every month. say if i have two columns and my start and end date is 07/11/2016 to 13/11/2016
column A column B
07/11/2016 23
08/11/2016 20
09/11/2016 10
10/11/2016 05
11/11/2016 10
12/11/2016 20
13/11/2016 10
My result should come like taking the average of column B
Column A Column B
13/11/2016 14.00
It means i should consider the past value and aggregate it to the day Sunday of that week. Also if my start and end date is like 07/11/2016 to 10/11/2016 then I should not aggregate the value as my week is not complete. I am able to aggregate the values but if my week is not complete i m not able to restrict the aggregation.
Is there any way to do this in PL/SQL??
Thank you in advance.
select to_char(columnA, 'iw') as weeknumber, avg(columnB)
from table
group by to_char(columnA, 'iw');
This will aggregate by number of week. If you need to show last day of week as a label you can get it as max(columnA) over (partition by to_char(columnA, 'iw'))

Resources