How to implement table view in sencha - sencha-touch

Can anybody tell How to implement table view in sencha
I want to display view with tabular format with vertical line
Column1 Column2 Column3
S.no Name Age
1 test1 23
2 test2 24
3 test3 25
Thanks

You can use touch-grid package for this but this is available only with Sencha complete. So if you used sencha-complete then its easy to do this.

Related

Splunk: How to implement "max(Index) by Version"

I have "version" and "Index" variables
"Version" contains values like: 150,160,170...
"Index" contains values like: 1,2,3,4,5
Basically I want to know if there's an implementation for this kind of condition:
max(Index) by Version
Meaning for the below 6 events:
150 , 5
140 , 1
140 , 2
130 , 1
130 , 2
130 , 3
Ill get only those 3:
150 , 5
140 , 2
130 , 3
Because it has only the highest index for every version
Thanks!
Couldn't implement this from Splunk documentation:
Aggregation
max([by=<grp>])
When you call max(by=<grp>), it returns one maximum for each value of the property or properties specified by <grp>. For example, if the input stream contains 5 different values for the property named datacenter, max(by='datacenter') outputs 5 maximums.
You can use the stats command to find the maximum Index value for each Version.
| stats max(Index) by Version
Basically I want to know if there's an implementation for this kind of condition:
max(Index) by Version
What you're asking for seem to be precisely how you would call max with stats:
index=ndx sourcetype=srctp Version=* datacenter=*
| stats max(Version) by datacenter
Does that not do what you're looking for?
Thanks guys!
Eventually what was the trick was "eventstats", because I wanted the highest index for each event

Split not-atomar value into multiple rows with PostgreSQL

I have some not atomar data in a database like this:
ID
Component ID List
1
123, 456
2
123, 345
I need to transform those table into a view that provides the "Component ID List" in a way, that I can use joins. Expected result:
ID
Component ID List
1
123
1
456
2
123
2
345
Because I have this case in quite a few tables I look for the possibility to create a reusable way to perform this action, e.g. with a SQL-function. The tables have different column-names so the function would need a parameter, like this:
SELECT *, split_values("Component ID List") FROM xyz
I know the best way would be to fix the problem in the raw-data but that's not possible in this case.
Any suggestions how to solve this the best way possible?
You can use unnest(string_to_array(Component_ID_List, ', ')):
SELECT ID,
unnest(string_to_array(Component_ID_List, ', ')) as Component_ID_List
FROM table_name;
Fiddle

How can I extract comma delimited values from one column and put them each in separate column in Google Data Studio?

Update: 1,2,3 are just examples it can also be 4,24,53
I have the following setup:
I store Data in BigQuery and use BigQuery as data source for my Data Studio project.
I have a column called Alarms and the data inside that column is as follow: it can be empty or 1 or 1,2 or 1,2,3 or 5,43,60 and so on. If it's empty or has 1 value then there is nothing to worry about, but if there are 2 or more values I have to do something.
name
Alarm
Mark
John
1
Eddie
1,2
Peter
1,2,3
What I need is to be able to put every value in a separate column or create a dropdown or something.
For example something like the table below or two drop down menus one to select the name and the other shows the alarms. (I prefer the drop downs).
name
Alarm
Mark
John
1
Eddie
1
2
Peter
1
2
3
Here I select Peter and the alarm drop down shows 3 alarms. or for Eddie it just shows 2 alarms and so on.
I read something about regex but I don't really understand how to put it to the test.
I found this online: (.+?)(?:,|$) but I don't know how to capture the output.
What I need is to be able to put every value in a separate column
Consider below approach
select * from (
select * except(alarm)
from your_table,
unnest(split(alarm)) flag with offset
)
pivot (min(flag) as alarm for offset in (0,1,2,3,4))
If applied to sample data in your question -output is

Parsing column data in SQL Syntax to an SQL Query

I am trying to solve a business flow issue at my work and I have an idea that I hope is technically feasible in SQL. What I would like to try and do is store different formulas in SQL syntax into database columns. Within SQL queries I would set variables to equal these columns so that the content of the columns is parsed as a part of the query and the different SQL statements pops up depending on the select specifications.
Short and sweet: I have some widgets to sell and whether or not a client can get these widgets depends on what other widgets they have bought, should have and shouldn’t have, country, customerid, their widget version, widget category and a couple of other things.
My question is how would someone proceed with this? I’m sure someone has made a similar setup before but which methods would be useful to study for my case? Are there case studies where I can find inspiration? I have searched for this without any luck. Hopefully someone who have solved similair issues before would be able to point me in a direction.
Thanks to whom‘ever is able to answer and has had the interest to read my post.
Best regards
Zaid
**OK this is more of a comment than an answer but the formatting doesn't work if I enter it as a comment!
To very vaguely answer your question I would have a Widgets table ie
WidgetID | Widget Name
1 Widget1
2 Widget2
3 Widget3
4 Widget4
Then have a WidgetRequirements table which is
WidgetRequiredID | WidgetID | RequiredWidgetID
1 1 2
2 1 3
3 1 4
4 2 4
5 3 1
6 3 4
This tells you that WidgetID 1 needs Widgets 2, 3 and 4 in order to be "active".
Widget 2 only needs widget4 to be active and Widget3 needs widgets 1 and 4.
This should get you started, expand on this theory.

Datatable Compare Rows

I have a datatable object, which is populated from a webservice.
Apparently, the web service just throws everything (data) back to me. The data which gets in my datatable looks like this:
Dept Code Value
Science ABC 5
Science ABC 6
Science DEF 7
Math ABC 3
Math DEF 9
English ABC 2
English DEF 3
English DEF 4
English DEF 5
Now, I want to create a datatable that will calculate (and sum)/ eliminate the values in the datatable, so that the new datatable would have the data like:
Dept Code Value
Science ABC 11
Science DEF 7
Math ABC 3
Math DEF 9
English ABC 2
English DEF 12
Please take note that I could only modify the datatable.
Can anyone help me? VB.Net please. Thanks.
A simple summary query will give you what you want:
SELECT Dept, Code, SUM(Value) sum_value FROM datatable GROUP BY Dept, Code
You could also create a view with that SQL definition, so you could
just query the view as you would a table. If you start to get so much
data that the query is slow, you'll want to store the results in a
permanent table - but for moderate amounts of data this should work fine.