In this tutorial you will learn how to create apps which use data.
In Qalcwise you can create two different data structures: lists and data tables. You can use them in creating your apps.
Start with creating a list. To do so click 'Create a new list' button in designer. This list will contain information about different countries, for example countries of Europe.
First list field name 'Country_name' and then add three more fields named: 'Capital', 'Population' and 'Group'. Set 'Population' field type as Number.
You can use data from this table:
|Bosnia and Herzegovina||Sarajevo||3871643||southern|
Now create a new app. Add a spreadsheet widget with two columns. In first row of the column A put 'choose group' and in the second row 'choose country'.
Then go to 'Data' tab, find your list there, expand list by clicking + and drag 'Country' and 'Group' fields to the spreadsheet.
To be able to choose country from the group you have to change field 'Elements' LOOKUP formula in cell B2.
'group=B1' fragment was added.
(More about LOOKUP formula here)
Add a new spreadsheet widget. It will be showing data about chosen country.
To make it possible you need to bind this section with your list. You can bind one section with only one list record(row) - it means that a spreadsheet can view information about only one country at a time.
In order to bind this spreadsheet go to 'Data' tab and find your list there and drag it to the section's name.
In column A cells write: 'Country','Group', 'Capital' and 'Population'.
Now drag all of the list fields to column B.
Your spreadsheet should now look like this:
*By dragging fields from a list without binding the list to the section you automatically create a dropdown in the cell you dragged it to. This is what you did in your first spreadsheet.*
In order to make this spreadsheet view information about the chosen country you need to change the LOOKUP formula in this spreadsheet:
You have to add 'country=Section1.B2' in 'Filter' field.
Sections and cell names may differ from yours. Make sure that you've added them correctly.
Add a new table.Just as you did with the previous spreadsheet you need to bind it. The difference between a table and a spreadsheet is that in a table you can view information about multiple records at a time. One table row contains information about one list row.
Drag 'Country' field to column A and 'Population' field to column B.
In order to make the table view information about countries from the chosen group you need to fill LOOKUP formula in 'Filter' field with search criteria:
Fragment 'group=Section1.B1' was added. Section1 is the first spreadsheet that you created and B1 is the cell where the group is chosen.
We want to view population in millions in column B. That's why we have to divide population by million. Simply add: /1000000.
You can change column A and B headers.
Change column B type to 'Number'. Put 0.00 in 'Display format' field. To be able to compare chosen country to the group choose sorting option.
Now by clicking 'preview' button you can check if the app works properly.
It should look something like this:
The last thing that you need to do to make the app fully work is to add yourself or 'All' as app creators.
And voila - your app is finished!