Getting title for previous period/SP previous year measures in SDK? - gooddata

I have created an insight with a date filter, and enabled "Compare the period with", selecting either "Same period previous year" or "Previous period" for all measures (I only have one). In the insight designer, things are labeled as expected: One color with my measure name, and another with measure name - SP year ago.
However, when I get the visualization object for my insight, the SP year ago measure does not have a "title". I can manually compute the title, but is there a way to get it through the API?

Title for PoP/Previous period is not stored in visualization object but instead generated in Analytical Designer from original measure's title, so we can correctly localize it. So to answer your question, there is currently no way to get it from API.
Peter

Related

How to bypass default parameter to include a range or better SQL?

EDITED (AGAIN): added tables and two screenshots (one of Google Sheets Chart and another showing mutliple issues in DS) to help demonstrate what I am seeing.
Short Version: I have created a parameter to help me score trending topics based on the date range filter. However, I want to be able to show a range of dates' worth of data, not just a specific date's worth of data. In theory, I could make the parameter a checklist with a huge range, but that doesn't seem efficient or sustainable down the road.
Disclaimer: I am about a week into SQL and Data Studio.
Long Version: We are tracking trends over time from a specific customer data set. I'd like to make it so that when a user adjusts the time range, various topics’ " score " depends on the end date. For instance, every time the topic "Recession" is brought up, it is given a score. That score is weighted based on when it was said. I was using 365 as the highest possible score so that anything over a year is null. So if "Recession" is referenced twice, once a week ago and once today, the avg score for recession is 361.5, but if a reference is made to the topic "Talent Management" twice today, then it would have a score of 365, and so forth across a growing list of 50+ topics pertaining to 50+ specific communities we are tracking the topics across.
Here is an example:
topics
groups
entry_date
recession
A
2022-11-24
talent mgt
A
2022-11-24
recession
B
2022-11-22
economy
A
2022-11-22
recession
C
2022-11-15
talent mgt
B
2022-11-8
This score would then affect the bubble size on a chart where the Y-axis is the count of unique groups referencing the topics, and an x-axis based on the range of average scores.
The goal is to be able to see which topics are the most common across groups, which ones are emerging trends, and which ones are dated trends by having a range slider. That way users (colleagues in other departments) can play with the date range "see" the bubbles moving in location and size.
example of static chart in google sheets
I could then also use the same data and fields to measure the percentage of topics being discussed across groups based on the weighted averages against a time range.
In Goolge Sheets I can do this with an xLookUp to a tab that has a column of 0-365 and then next to it a column of 365-0 (on a tab called 'scales') and then a cell on a sheet that you can put any date as the point in time, and it affects all the scores, tables, charts, etc. (I used. =xlookup((point_in_time - entry_date), 'scales'!A:A, 'scales'!B:B, "0")
In the data studios custom SQL I used:
SELECT
*
FROM
`qRaw_data'
where
DATE(_entry_dates_) between
parse_date('%Y%m%d', #DS_START_DATE) and
parse_date('%Y%m%d', #DS_END_DATE)
AND
#pit_date_diff = date_diff(
parse_date('%Y%m%d', #ds_end_date),
_entry_dates_,
day
)
Then I created a field that is time_score of:
avg((Pit_Date_Diff-365)*(-1))
I have been googling and youtubing like crazy and think I either have to come up with a way to override the #pit_date_diff default value OR I need to use a CASE WHEN in the custom query where each time the date_diff is 1 then 365, and so on, but when I try that I get all sorts of errors.
I would like below to include all topics averaged based on all entry dates, not just those that correlate with the inputted parameter field.
currently, I can only show specific entry dates due to the parameter
I appreciate any and all help. I am a week into using data studio and am going cross-eyed Googling and YouTubing things. There is likely a better logical path to accomplish all this. Hoping for a holiday miracle.
Thanks in advance.
It turns out this was much easier than I realized... I added an AS syntax to create a column and then created a field that created the same metrics that I had in the Google Sheets:
SELECT
*,
(date_diff(parse_date('%Y%m%d', #ds_end_date), _entry_dates_,day)) AS q_time_diff
FROM
`qRaw_data`
Then the score field is: (avg(q_time_diff)-365)*(-1)
In case that helps any others in the future... ¯\(ツ)/¯
Happy Holidays!

Power BI Waterfall Chart Issue

Is there any way we can disable the change over period value in waterfall chart.
I am not able to view the total value. Its showing the difference between the total and previous year. But i want to see the total of current year.
Use one of the column charts instaed. That's what they are made for.

Tableau - Count Items in a Dimension based on what month they fall into

I am a newbie at Tableau (thought I have spent years working in R and Python), seems to be different in the way it handles things or I'm just not thinking the right way.
I have a data sources with training data (employees training and the status). The point is to build a dashboard that shows the % of training that is overdue. I have all of the logic for it, but I am stuck on something.
I have a calculated field to show me the total training due, then when I put that in a table, with a filter by year and a breakdown by month, I get the totals by month - good deal.
Now, I need to perform an year calculation (not the months, but the year based on a few different things), so my first step is I need to get the "Total Training Due" for December 2018. I have a dimension called "Due Month" which is a numeric (1,2,3,4, etc.) representing the month. So, based on what I have observed, I just need to do a little IF statement like so (keep in mind this is only for 2018 data right now):
IF [Due Month] = MAX[Due Month] THEN COUNT[Employee ID] END
I know this isn't the exact context, but it's sort of what I am looking for. So, for 2018, it would mean that, for all rows that are of month 12, I want to count those up (each row is a unique training requirement) and I want the total for the latest month in the data set. My overall goal is to create the calculation I need in a new sheet with a single calculated field (See the image below of the Excel spreadsheet and the J10 calculation). Then I can use a dashboard to combine everything. I thought about a total row at the bottom, but there isn't enough ways to change the totals to customize it to what I need. I figured I dashboard was the way to go and replicate each part it its own sheet.
I have seen so many suggestion for things like this, but not exactly this. I have tried many, but nothing that works. Here is the spreadsheet I am trying to replicate:
As you can see that calculation in J10 is kind of weird, no biggie for Excel, but I am struggling to replicate this in Tableau. Here is what I have in my Tableau so far, I'm 90% of the way there, I just need that last calculation. I have replicated the main table, and figure I'll do this J10 calc on a new sheet and just put them together on a Dahsboard. The only thing is, I want this to work when new data comes in, so I don't want to hard code any month numbers in there, I want it to be dynamic. Here is what I have on the tableau so far:
Thanks in advance!!
To get the value in Tableau that you have in F11 it's:
{FIXED [Due Year] : sum([Incomplete Overdue])}
You should be able to create that as another calculated field and then reference it, or include it directly in the Total Past Due Rate calculation.
This is an LOD calculation, the [Due Year] means that you only want the result dimensioned by the [Due Year] dimension, so you will get a different result for each year in the data source.
Thanks for this - after posting this, I was able to come up with this:
(TOTAL([Incomplete Overdue]) + SUM(IF ([Past Due]<0 AND INT([Due Month]) = {MAX(INT([Due Month]))}) THEN 1 ELSE 0 END)) / COUNT(IF INT([Due Month]) = {MAX(INT([Due Month]))} THEN [Employee ID] END)
Which works for the basic result I was looking for.

Excel - VBA - Access: Date Selection Solution

I'm looking for a direction, assuming that surely someone has had to do something similar and I'm making this more difficult than it is.
We have an Access DB, feeds to a pivot table in Excel, which is in turn used to supply charts for a "user dashboard." This is 2010, so no slicers.
My problem is that that DB is updated adding months to a field. There is a listbox in the dashboard that will allow the user to select a specific month and see stats for that time. I'm having a couple problems even getting started and would like to make sure I'm going about this the simplist/most efficient way.
My thought was to populate the listbox with the 'month' fields from the pivot table. I'm not quite sure how I'm going to do that with VBA (I have a couple ideas), but if that's the best route then I'll figure it out.
But, has anyone had a similar need, and found a better solution? I have a bunch of buttons to handle other fields, but I would really like to allow for the user to select a date/month/range...whatever. Surely this is a common, easily managed desire, no?
I'd put this in with the conversation you're having with a couple of people above, but I don't have enough rep to do that yet.
I had a similar dashboard issue years ago. Resolved it by adding a dropdown beside the month box (which was a dropdown in my case, not a listbox) with the options "Year to date" and "Month to date". By definition selecting a past month and MTD gave you the whole month, whereas selecting the current month can only ever give you MTD. Same thing with YTD - it would give you the combined stats for the current year to date instead of just one month.
The month dropdown in my dashboard was populated based on the current data in the pivot, which in turn was controlled from the database. We used a 25-month rolling select for the data and showed only the last 13 months in the month dropdown. That gave us a full 12 month spread of historical data to work from if someone chose the oldest month we offered them, yet kept the size of the pivot cache manageable
I used a dropdown for the options instead of option buttons or a checkbox, because I had a suspicion that delivering what was asked for would lead to additional requests. I was right. Eventually we had options for "Last year to date" (how we were tracking this day last year), "Quarter to date", "Financial year to date", and so on. Adding extra choices to the dropdown box was easier than rearranging the dashboard to accommodate the proliferating requirements.

Qlikview line chart with multiple expressions over time period dimension

I am new to Qlikview and after several failed attempts I have to ask for some guidance regarding charts in Qlikview. I want to create Line chart which will have:
One dimension – time period of one month broke down by days in it
One expression – Number of created tasks per day
Second expression – Number of closed tasks per day
Third expression – Number of open tasks per day
This is very basic example and I couldn’t find solution for this, and to be honest I think I don’t understand how I should setup my time period dimension and expression. Each time when I try to introduce more then one expression things go south. Maybe its because I have multiple dates or my dimension is wrong.
Here is my simple data:
http://pastebin.com/Lv0CFQPm
I have been reading about helper tables like Master Callendar or “Date Island” but I couldn’t grasp it. I have tried to follow guide from here: https://community.qlik.com/docs/DOC-8642 but that only worked for one date (for me at least).
How should I setup dimension and expression on my chart, so I can count the ID field if Created Date matches one from dimension and Status is appropriate?
I have personal edition so I am unable to open qwv files from other authors.
Thank you in advance, kind regards!
My solution to this would be to change from a single line per Call with associated dates to a concatenated list of Call Events with a single date each. i.e. each Call will have a creation event and a resolution event. This is how I achieve that. (I turned your data into a spreadsheet but the concept is the same for any data source.)
Calls:
LOAD Type,
Id,
Priority,
'New' as Status,
date(floor(Created)) as [Date],
time(Created) as [Time]
FROM
[Calls.xlsx]
(ooxml, embedded labels, table is Sheet1) where Created>0;
LOAD Type,
Id,
Priority,
Status,
date(floor(Resolved)) as [Date],
time(Resolved) as [Time]
FROM
[Calls.xlsx]
(ooxml, embedded labels, table is Sheet1) where Resolved>0;
Key concepts here are allowing QlikView's auto-conatenate to do it's job by making the field-names of both load statements exactly the same, including capitalisation. The second is splitting the timestamp into a Date and a time. This allows you to have a dimension of Date only and group the events for the day. (In big data sets the resource saving is also significant.) The third is creating the dummy 'New' status for each event on the day of it's creation date.
With just this data and these expressions
Created = count(if(Status='New',Id))
Resolved = count(if(Status='Resolved',Id))
and then
Created-Resolved
all with full accumulation ticked for Open (to give you a running total rather than a daily total which might go negative and look odd) you could draw this graph.
For extra completeness you could add this to the code section to fill up your dates and create the Master Calendar you spoke of. There are many other ways of achieving this
MINMAX:
load floor(num(min([Date]))) as MINTRANS,
floor(num(max([Date]))) as MAXTRANS
Resident Calls;
let zDateMin=FieldValue('MINTRANS',1);
let zDateMax=FieldValue('MAXTRANS',1);
//complete calendar
Dates:
LOAD
Date($(zDateMin) + IterNo() - 1, '$(DateFormat)') as [Date]
AUTOGENERATE 1
WHILE $(zDateMin)+IterNo()-1<= $(zDateMax);
Then you could draw this chart. Don't forget to turn Suppress Zero Values on the Presentation tab off.
But my suggestion would be to use a combo rather than line chart so that the calls per day are shown as discrete buckets (Bars) but the running total of Open calls is a line