How to display the title of a data column in code.org app lab? - app-lab

Does anyone know how to do this? I have tried everything I could think of in terms of how it could be stored as a variable, but I don't know what to do.

The title of a column is shown as its key name. For example, this:
| id | value |
| -- | ----- |
| 1| 6 |
is shown as this:
{
id: 1,
value: 6
}
The column name in this case is value. All you have to do is just put "value" (or whatever column name you're using) next to where you're showing the cell content.

Related

Ordering/Reordering the list based on a specific column which holds an order number in JPA

I'm using JPA and also I have a table like below structure:
|--------------|--------------------------------|
| ID | Title | OrderNumber |
|--------------|--------------|-----------------|
| 1 | Test | 0 |
|--------------|--------------|-----------------|
| 2 | Test2 | 1 |
|--------------|--------------|-----------------|
So, It's easy to order the list by the 'OrderNumber' in queries, but I've not found an appropriate way to update/set its value in reordering operation yet (Because I have an option in user-side to change the order of the list by drag and drop).
What is a suitable way to solve this problem without any store procedure in the database?

Problem with positioning of charts in superset dashboard

I want to put some charts on Superset dashboard. The layout I want is like this:
____________________
| | |
| | B |
| A |_________|
| | |
| | C |
|__________|_________|
A is a chart with some main info and B and C are details of it. The problem is if I put B as it is then C cannot be put below B and will form a completely new row. I tried to achieve this form with an empty row or column or separator and no luck yet.
Try following these steps and see if it works:
Add an empty row
Add two empty columns in it
Add two empty rows on the right column
Add charts into desired cells.
Adjust width and height.

Start Questetra process with values expressed by "Label" rather than by "Choice ID"

I can start a Questetra process like with this request:
curl https://sample.questetra.net/System/Event/IntermediateMessage/123/0/start \
-d "data[0].selects=new_york"
... where the final parameter's value is the "Choice ID" in this table (called the Master file of Choice type data item in Questetra):
+-----------+----------+
| Choice ID | Label |
+-----------+----------+
| new_york | New York |
| paris | Paris |
| ... | ... |
+-----------+----------+
Problem: The client app only has data in the format of the Label column. For instance, the client app has New York but has no way to convert that to new_york.
Question: Is there any way to start the Questetra process using values from the Label column as arguments?
Either by specifying them directly and setting some kind of flag, or by getting the values "translated" using a preliminary request, or any other way.

Showing Complete Set of Data with Filter and parameter - Tableau 10

I have a set of data below.
| AdviserName | PolicyNumber | Product | Status | Duration |
|-------------|--------------|---------|--------|----------|
| Andy | LIF123 | ANZ | New | 2 |
| Andy | X224 | AXA | Lapsed | 3 |
| George | KL1122 | TAL | New | 0 |
| George | OLK43 | AXA | Lapsed | 5 |
| Ben | LIF98 | ANZ | New | 0 |
| Ben | KL343 | TAL | Lapsed | 1 |
I want to get the set of data where the status = 'Lapsed' duration between 1 to 3. However I still want to show correspond status = 'New' for each adviser. Below is the expected result that I want to see.
| AdviserName | PolicyNumber | Product | Status | Duration |
|-------------|--------------|---------|--------|----------|
| Andy | LIF123 | ANZ | New | 2 |
| Andy | X224 | AXA | Lapsed | 3 |
| Ben | LIF98 | ANZ | New | 0 |
| Ben | KL343 | TAL | Lapsed | 1 |
I created 2 parameters :
MinYear with the value set to 1
MaxYear with the value set to 3
I created 2 calculated fields :
MinInvYear which is iif([Duration]>=[Min Year] and [Status] = 'Lapsed', 1, 0)
MaxInvYear which is iif([Duration]<=[Max Year] and [Status] = 'Lapsed', 1, 0)
Last step, I put both calculated fields into the filters and tick the filter = 1 only. Unfortunately what I got is the table below. I need to show the status 'New' as well for Andy and Ben.
| AdviserName | PolicyNumber | Product | Status | Duration |
|-------------|--------------|---------|--------|----------|
| Andy | X224 | AXA | Lapsed | 3 |
| Ben | KL343 | TAL | Lapsed | 1 |
I tried to modify the calculated field using Level of Detail :
MinInvYear which is {include [Status] = 'New Business' : iif([Duration]>=[Min Year] and [Status] = 'Lapsed', 1, 0)} and I got error message 'Result of a level of detail expression must be aggregate.'
What am I missing?
FYI, I'm using Tableau 10.
Thanks all for your help.
Instead of the 2 calculated fields MinInvYear and MaxInvYear, try adding a calculated field (let's say Filter for Status and Duration) which returns a boolean value based on your condition
IF ([Status] == 'Lapsed' OR ([MinYear] < [Duration] AND [Duration] < [MaxYear])) THEN
TRUE
ELSE
FALSE
END
Now, add a filter for this calculated field to show only records which result in True.
try this, Bit lengthy but works for sure:
You are manipulating on only one aspect (Lapsed) of the field status, hence you are applying the parameter values on only that value. So here you need to independently work on that column to get the required output. Follow the below process:
Create 2 sets for each value in status column:
Set 1: Lapsed
Here create a set and just select checkbox `Lapsed`.
Set 2: New
Here create a set and just select checkbox `New`.
Create two calculated fields to extract the required data separately for Lapsed and New
Calculated Field 1: Lapsed_Status
IF [Duration] >= [Min] and [Duration] <= [Max]
THEN [Lapsed] //Set
END
Calculated Field 2: New Status
IF [New]=[New]
THEN [New] //Set
END
Create two more sets out of 2 calculated fields (created in step 2) to just select only those values that are needed for display on sheet:
Set 3: Display_Lapsed //From Calculated Field 1: New Status
Select checkbox True
Set 4: Display_New //From Calculated Field 2: Lapsed_Status
Select checkbox True
Now we have our required data in 2 sets, Create one more calculated field and use in filter
Calculated Field 'Display_sheet'
Display_Lapsed <> Display_New //Both are sets
Use the calculated field Display_sheet in filter and select true
Use the required fields on the sheet to display data.
Let me know how it goes
Below trick will get you moving
Duplicate the data source (right click on the data source in 'Data' panel -> 'Duplicate') having above data
Drag AdviserName from the original data source in 'Rows' view
Click on the duplicated data source in 'Data' panel. There you'll find 'link symbol' next to every dimension (in grey color). Click on the 'link symbol' next to AdviserName and it'll turn 'red' (if it turns grey don't worry. Click again and it'll turn red). Be sure that only one 'link symbol' is red (which is next to AdviserName).
Create a calculated field filter_cond in this duplicated data source as
IF [Status]='Lapsed' and [Duration]<=3 and [Duration]>=1
then 'Y'
ELSE 'N'
END
Drag filter_cond in 'Filters' view and select 'Y'
Now drag PolicyNumber, Product & Status from the original datasource in 'Rows' view. You are done!
Voila!

compound attribute in ezpublish content class

I am designing a content class in ezpublish 5 where i need a filed like rating in different categories. I want to give content editor an interface in admin panel where he can choose a category to rate from dropdown and then text field to put rating point (1-5).
How to achieve this in ezpublish5?
The Matrix data/fieldtype sounds like it's close to what you need.
It allows you to set a table of values with a set number of columns. The limitation here is that each field is a free text entry for users.
| Review | Rating | Notes |
|-------------------|-------------|--------------------|
| Customer Service | 5 | Friendly & polite |
| Quality of Food | 4 | Tasty & Plentiful |
| ... | ... | ... |
There is a symfony bundle available for the Matrix fieldtype to allow access to the data in the Symfony stack: https://github.com/ezcommunity/EzMatrixFieldTypeBundle.
Alternatively there is the option to create your own data/fieldtype: http://share.ez.no/learn/ez-publish/creating-datatypes-in-ez-publish-4 & https://doc.ez.no/display/EZP/eZ+Publish+5+Field+Type+Tutorial

Resources