Countdown timer powerbuilder - timer

I have a datawindow with 3 columns. I want to somehow inform the user that the value of a column is available 5 days from today. Like a countdown. After those 5 days the column takes the default value. Is that possible?

Use data window expressions!
They can be used via the datawindow painter and allow very fine control on the display without the burden of programming. More specifically, in this case, I suppose you have a column 'expiry' to specify the maximum period of availability.
In the datawindow painter, click on the column for which you want something to happen. In the 'Background' tab, put
Gradient: horizontal
Color: Red
Spread: expression (see the little box on the right?)
'spread' can have a value from 0 to 100, so compute an expression to go from 0 to 100 depending on the number of remaining days:
100 -((5 - if(daysafter( expiry , today ) < 5, daysafter( expiry , today() ), 5 ))* 20)
With this, the 'red' background color will spread more or less depending on the number of days remaining.
Other possibility: use the 'Tooltip' tab, enable the tooltip (first field) and put as message: 'You have ' + string (daysafter(expiry, today()) + ' days left to modify this field'
This will show a message (variable with the line) everytime you pass with the mouse on the field.
Once you get the trick, you can play around and have your own ideas using these datawindow expressions.

Related

Chart showing a comparison after checking a checkbox

I'm trying to figure out how to connect checkbox with chart.
What I need to do is the following:
I have a chart showing two lines (two sets of data, lets name them A and B).
After checking a checkbox "compare A with previous period" or "compare B with previous period" those data disappear and instead of them a suitable comparison is shown.
I know that it is possible to make checkbox dependent chart like here:
https://datastudio.google.com/reporting/23a0d8ac-96c0-42cc-a991-5a21bc7c9962/page/VvbsB?s=rw4uzVA5G9Y
but I don't know how to do it.
I tried looking for the solution on the Internet, but nothing found.
Thank you for your help in advance.
A step by step introduction how to blend data and add checkboxes to show/hide graphs. Also how to do a calculation across datafields in different datasets, which were blended.
Add to the dataset a checkbox with the name compare_a_with_previous_period the field 3days average on/off with
case when compare_a_with_previous_period then 3days average else null end
Depending on the checkbox data is shown in that field or not (null). For blending/joining the data over different dates, a timeshift has to be done. Therefore, create a field date_old with
datetime_add(Date,interval 30 day)
Create an parameter show_differences with range 0 to 1 and add a field show_differences with
case when show_differences = 0 then 0 else 1 end
This will later be used to switch on/off the graph for the difference calculation.
Blend the data with itself using date and date_old as join and range. And rename the 3 day average to 3 days_old
Add the chart and click on the "add metric"
and enter
case when show_differences > 0 then 3days average - 3days_old else null end
to do a calculation between the bend datasets. Under Style set the missing data to "Line Breaks".

Want to highlight every other row in a group

I am trying to change the background color of every odd numbered record of each group in my SSRS report.
I know this will change the color of every even numbered record in the report.
=IIF(RowNumber(Nothing) Mod 2, "No Color", "Silver")
This will change the first record of each group. =IIF(Fields!EvaluatorID.Value=previous(Fields!EvaluatorID.Value), "No Color", "Silver")
It seems like combining them in an OR should do the trick. =IIF((Fields!EvaluatorID.Value=previous(Fields!EvaluatorID.Value)) or (RowNumber(Nothing) Mod 1), "No Color", "Silver")
But the color is not changing when there are 3 records in a group. Does anyone have suggestions on how to change the expression?
Just use this...
=IIF(RowNumber("myRowGroupName") Mod 2, "Silver", Nothing)
You need to specify the row group name (case sensitive and enclosed on double quotes). This evaluates rownumber() within in each group so it will start at 1 again.
Then to flip odd and even highlighting, reverse the colours that are applied. I've also used Nothing as this is the actual default value used in SSRS, "No Color" is just a user friendly name shown in the properties window.

scorecard chart how use date, datastudio

I would like use latest date value from my table in Scorecard,
Any idea how to import this Date value in DataStudio report ?
There is no option like "Max Date", similiar to Max value used in Digit Values.
There is only Count option:
Or advice how to insert date as Label to another ScoreCard chart.
2)
One more question: Is it possible to insert date function in Text field? Probably not right ? If I wanna join my line of text with some Date
Hi Nim thanks for help and what about if I want show last data from last 3 days in 2 item dimension table ? In one item I can just use row filter, but how in 2 item ?
In my case for example most 5 countries by last 3 days, by now I can only show most 5 countries by last day:
...Actually I can setup in the bottom option : date range (last 7days), but I have still too many rows, solution should be somehow limit number of rows per day...somehow
Question 1: How to display the Max Date LIKE a Scorecard?
1.1) Data Tab
- Chart Type: Table
- Dimension: Date
- Sort: Date in descending order
- Rows per page: 1
1.2) Style Tab
- Show Header: Deselect
- Row Numbers: Deselect
- Show Pagination: Deselect
- Table Labels Font Size: As required (e.g. 24px)
1.3) Text Box
- Add a Text Box stating Max Date if required
- Precision Movement: Use Shift + Movement keys to finely place the components exactly where required.
Google Data Studio Report and GIF to expand on the above:
Question 1 (Original Post - Currently doesn't work as expected): How to display the Max Date on a Scorecard?
At the Metric field of the Scorecard, create a Chart-level Calculated Field that explicitly aggregates the Date field by MAX:
MAX(Date)
Google Data Studio Report and a GIF to demonstrate:
Question 2: How to display the latest Metric?
2.1) Data Tab
- Chart Type: Table
- Dimension: Date
- Metric: As required (e.g. Sessions)
- Sort: Date in descending order
- Rows per page: 1
2.2) Style Tab
- Show Header: Deselect
- Row Numbers: Deselect
- Show Pagination: Deselect
- Table Labels Font Size: As required (e.g. 24px)
2.3) Overlay
- Add a shape or text box over the Date field part of the Table to ensure that it's not visible and set the colour of the shape to a solid colour that blends in with the background (such as White for a White coloured background).
- Order: Ensure that the shape or text box is placed in front of the Table.
- Precision Movement: Use Shift + Movement keys to finely place the components exactly where required.
Google Data Studio Report and GIF to elaborate:

SSRS chart labels

I need some help figuring out how to accurately display the labels in a stacked chart in SSRS; I need a single represenation of the upper stack in the below chart.
The chart itself has two states, it can either be based on red or green data, both are in the same data source.
At the moment the chart looks like this (this is based on green data):
As you can clearly see both the labels inside the chart and the legend is absolutely cluttered. The idea is to have a legend where we have two items (Late issues and Not finished issues); one that displays any non-finished issues and one that displays any non-finished issues that are outside the estimated due-date.
For reference: The above chart should have 1 non-outstanding issue and 5 outstanding issues (3 Ongoing and 2 Open, see below for further info about stages).
Inside the chart we want to have a numerical respresentation of above requirements. Basically a number representing the outstanding issues and one that shows any non-finished issues.
This is what a red representation looks like:
At this point I'm not sure what could be wrong anymore. As mentioned they both run on the same dataset, but with slightly different values.
The red tracker has a simple True/False value that it runs most of its data from whereas the green tracker has a numerical representation of three values (5-7). Where the data it represent is: 5 - Open, 6 - Ongoing, 7 - Closed.
I've attempted to only get the green data both when the series is either of the three above mentioned numbers, but also when it's only getting anything that is un-closed (5,6 but not 7).
This is the code to set the labels for the maroon part of the chart (it's only a workable snippet.):
IIF(Count(IIF(Fields!Outstanding.Value = 1 AND
Fields!TRK_TrackerStatus_LKID2.Value <> 7, 1, Nothing)) = 0, "",
Count(IIF(Fields!Outstanding.Value = 1 AND
Fields!TRK_TrackerStatus_LKID2.Value <> 7, 1, Nothing))))
Basically what it does is checking if there are more than 0 items that are outstanding and that aren't finished (are not 7). If there are more than 0, it sets the label. If there are 0 counted items, the label should be the empty string.
I think what you are wanting to do is group your Series data based on a status number. You can either do this as a case statement in your dataset query or you can use an expression in your Series Group:
The expression I have used there is as follows:
=switch(Fields!Status.Value = 5, "Group 1", Fields!Status.Value = 6, "Group 2", Fields!Status.Value = 7, "Group 2", TRUE, "Group 3")
This esentially assigns a grouping value to your data based on the values in the field. In this case, a Status of 5 becomes Group 1, a Status of 6 or 7 becomes Group 2 and all other values become Group 3 just to ensure bad data is obvious on the report.
What this does is takes the chart as it would be displayed with the raw data (On the left) and turns it into what I think is how you want to see it (On the right):
You will need to apply the same logic to your chart labels as well. For this reason I would recommend you add a column to your original SQL script that does this grouping for you, so you only have to make changes once.

SSRS Conditional Expression

In SSRS report, I want to perform conditional color formatting where highest rank should be Green and lowest rank should be Red within a Regional Manager group as shown below
Note: Couple of options, I was thinking of includes
I am using custom code function, for deriving Min and Max value, and somehow if I can include grouping filter on Regional Manger then it could work, but don't know if that's possible
In dataset, I create extra columns for each column and store Min\max value in it. But less keen towards this option, since I have 24 different ranks and which would mean, I will need 24 different columns along with current 40 attributes
Any help would be appreciated
I know you don't want to do this for each column, but despite your misgivings it is probably the best approach. Based on my previous answer to your earlier related question you can colour the min and max for each group as follows.
Create a table with fields store, atvrank, and btvrank
Right click the row header, and select Add Group -> Row Group - Parent Group, and choose Regional Manager. Set the Group name to RegionalManagerGroup
Then set the background colour for your cells to
=iif(Fields!atvRank.Value = min(Fields!atvRank.Value, "RegionalManagerGroup"),
"Green",
iif(Fields!atvRank.Value = max(Fields!atvRank.Value, "RegionalManagerGroup"),
"Red",
"White"
)
)
This now finds the maximum and minimum within the current group instead of the whole dataset. You will need to set this expression for each field individually, but this is probably less effort than returning new rows from the database to determine the maximum and minimum for each field.
This approach will give the following output
Please seriously consider this solution. If you have further questions, please just ask.

Resources