Subgrid with a FooterRow - jqgrid

Is it possible to set to a jqGrid subgrid a footerrow. I have a mainGrid that contains many rows and every row have a subgrid.
Or must I use the Master-Details way to do this like here ("Advanced" -> "Master Detail")
The Grid should looks like this:
| Col1 | Col2 | Col3
_______|__________|___________|___________________________
- | value1 | value 2 | 10
|__________|___________|___________________________
| Subgrid col1 | Subgrid col2 | Subcol3
|__________________|__________________|___________
| subgridvalue1 | subgridvalue2 | 15
|__________________|__________________|___________
|another subridval1|another subridval2| 5
|__________________|__________________|___________
| | Totals: | 20
_______|__________________|__________________|___________
+ |oter value|oter value2| 12
_______|__________|___________|___________________________
footer:| | Totals: | 22
I hope you can understand what I mean.

If you would use Subgrid as Grid you will be able to have any elements in the subgrids inclusive footerrow option.

Related

How I can customize the table's header using the Datatable component?

At this moment I have a table that uses the DataTable component. The last column of the header is "Actions", but since the actions are obvious, I want to delete this text and move the "Show records" element of the table, to the same position where the text is now.
Show XX records
|--------------------------------------------------|
| col1 | col2 | Actions |
|---------------------------------------------------
| col1 row1 | col2 row1 | Edit Remove |
|---------------------------------------------------
| col1 row2 | col2 row2 | Edit Remove |
To make it looks like this:
|--------------------------------------------------|
| col1 | col2 | Show XX records|
|---------------------------------------------------
| col1 row1 | col2 row1 | Edit Remove |
|---------------------------------------------------
| col1 row2 | col2 row2 | Edit Remove |
Can someone please help me?
Thanks so much
what you need is to use fnInfoCallback and change the header cell value in which you want to show info
"fnInfoCallback": function (oSettings, iStart, iEnd, iMax, iTotal, sPre) {
$('#dtexample thead tr:first-child th:last-child').text('Showing ' + iStart + ' to ' + iEnd +
' of '+iTotal );
}

DAX - check for the existance of a column in the query

Is it possible, in a DAX measure, to check if the current query contains a particular column?
For example, I have a column named "Time" - is it possible to detect if a user in a self service environment has included this in their report, from the measure?
Edit - adding example of an output
An example output would be below
+---------+---------+------+--------------+
| Col1 | Col2 | Col3 | ContainsCol3 |
+---------+---------+------+--------------+
| Value 1 | Value 2 | 123 | True |
+---------+---------+------+--------------+
+---------+---------+------+--------------+
| Col1 | Col2 | Col4 | ContainsCol3 |
+---------+---------+------+--------------+
| Value 1 | Value 2 | 123 | False |
+---------+---------+------+--------------+
The query containing Col3 returns true, the query that does not include col3 returns false.
not exactly, but you can use functions like ISCROSSFILTERED, ISFILTERED, HASONEFILTER, HASONEVALUE which might be sufficient depending on your end-goal.

Column to comma separated value in Hive

It's been asked and answered for SQL (Convert multiple rows into one with comma as separator), would any of the approaches mentioned work in Hive, e.g. to go from this:
+------+------+
| Col1 | Col2 |
+------+------+
| a | 1 |
| a | 5 |
| a | 6 |
| b | 2 |
| b | 6 |
+------+------+
to this:
+------+-------+
| Col1 | Col2 |
+------+-------+
| a | 1,5,6 |
| b | 2,6 |
+------+-------+
The aggregator function collect_set can achieve what you are trying to get. Here is the documentation. So you can write a query like:
SELECT Col1, collect_set(Col2)
FROM your_table
GROUP BY Col1;
However, there is one striking difference between MySQL's GROUP BY and Hive's collect_set that while GROUP_CONCAT also retains duplicates in the resulting array, collect_set removes the duplicates occuring in the array. In the example shown by you there are no repeating group values for Col2 so you can go ahead and use it.
And there is collect_list that will take full list (with duplicates).
Try this
SELECT Col1, concat_ws(',', collect_set(Col2)) as col2
FROM your_table
GROUP BY Col1;
apache.org documentation

Joining tables with same column names - ORACLE

I am using Oracle.
I am currently working one 2 tables which both have the same column names. Is there any way in which I can combine the 2 tables together as they are?
Simple example to show what I mean:
TABLE 1:
| COLUMN 1 | COLUMN 2 | COLUMN 3 |
----------------------------------------
| a | 1 | w |
| b | 2 | x |
TABLE 2:
| COLUMN 1 | COLUMN 2 | COLUMN 3 |
----------------------------------------
| c | 3 | y |
| d | 4 | z |
RESULT THAT I WANT:
| COLUMN 1 | COLUMN 2 | COLUMN 3 |
----------------------------------------
| a | 1 | w |
| b | 2 | x |
| c | 3 | y |
| d | 4 | z |
Any help would be greatly appreciated. Thank you in advance!
You can use the union set operator to get the result of two queries as a single result set:
select column1, column2, column3
from table1
union all
select column1, column2, column3
from table2
union on its own implicitly removes duplicates; union all preserves them. More info here.
The column names don't need to be the same, you just need the same number of columns with the same datatpes, in the same order.
(This is not what is usually meant by a join, so the title of your question is a bit misleading; I'm basing this on the example data and output you showed.)

jqgrid, tooltip using table

I have a jqgrid table and I'd like to allow users to click on an icon, invoke a URL and display the resultant data as a table inside a tool tip:
+-----------------------------+
| title1 | title2 | title 3| |
-----------------------------
| data1 |data 2 ? | data 3 |
+-----------------------------+
|data11 |data 21 ?| data 3 |
+----------------------------------+
| child table |
+-----------------------+
| |
------------------------+
In the above picture, the child table would be a tool tip

Resources