I'm creating a report ( module ) in openERP using Aeroo report
for the report template i use liberoffice
i want to hide and show a table row depending on the result of (If condition )
for example if type= A then show the row
if type=B then hide a row
help will be appreciated
Thank you in advance
Related
Screenshot of my settings. On Interactive Grid - I have column-a "TaskID" and other column-b is "Predecessors", which is LOV of “TaskID” column. Each TaskID has a start date in Column-C. When I change the column-b value, the column-C date should change. I mean it should look for the TaskID column and return the corresponding date.
Any suggestions would be greatly appreciated. May be a dynamic action or SQL query.. I don’t know
Column a (TaskID), Column b (Predecessors), Column c (StartDate)
Yes, using a dynamic action will be the easiest way to do this.
Create an on change dynamic action on your predecessors column:
Then create a Set Value Action using the corresponding SQL query:
Is it possible to add dynamic pivot columns in the APEX interactive grid query?
PL/SQL function body returning SQL query:
DECLARE
l_piv_col VARCHAR2(1000) := NVL(:P1_DEP_PIVOT,'10 DEP1');
l_statement VARCHAR2(4000):=
q'~
select rownum row_num,JOB,MGR,DEP1,DEP2,DEP3
from
(select JOB,
MGR,
SAL,
DEPTNO
from EMP
)
src
--PIVOT (sum(sal) for deptno IN (10 DEP1,20 DEP2,null DEP3)) Piv
PIVOT (sum(sal) for deptno IN (##PIV_COL##)) Piv
~';
BEGIN
RETURN REPLACE(l_statement,'##PIV_COL##',l_piv_col);
--RETURN l_statement;
END;
P1_DEP_PIVOT -> (10 DEP1, 20 DEP2, null DEP3)
In the pivot deptno in, I need to use the dynamic columns.
sum(sal) for deptno IN (##PIV_COL##)
I am not sure, how to add the dynamic pivot columns in APEX Interactive grid?
Any help is greatly appreciated.
Thanks
Thanks for the reproducible case.
Classic Report is the only APEX Component which supports the query returning a changing set of result columns. Interactive Reports and Interactive Grid do not support this.
In classic report, pick the region source as PL/SQL function body returning SQL query and enable the Generic Columns switch. Then configure the maximum amount of columns, and you're good to go.
There are a couple of workarounds that I can think of if you really need an interactive grid (IG).
Store the results of the query in a collection, create an IG on top of the collection and have a server side condition to hide the columns that should not be displayed
Make sure your query always returns a fixed number of columns and have page item (to manage hide/show) for each of the columns. If a column should not be in the pivot, hide it based on the page item.
Is there a way I can reorder columns in 'Data View' within Power BI? I tried doing it in Power Query first but when the data loads into the table, the columns automatically rearrange.
Edit after comment.
There is easy fix to enforce column order just as in Power Query:
In Power Query Editor > Disable Query Load. Close and Apply.
Open the Query Editor again, enable the Query Load. Refresh the Query. Then Close and Apply.
Answer to misunderstood question.
This may be interesting solution in M PowerQuery. The function below let you reorder columns by only stating few columns from the whole set of columns. Add this in blank query and rename it to FnReorderColumnsSubset.
(tbl as table, reorderedColumns as list, offset as number) as table =>
Table.ReorderColumns
(
tbl,
List.InsertRange
(
List.Difference
(
Table.ColumnNames(tbl),
reorderedColumns
),
offset,
reorderedColumns
)
)
Use it as this:
= FnReorderColumnsSubset( Source, { "Region", "RegionManager", "HeadCount" }, 0 )
Found it here:
https://datachant.com/2017/01/18/power-bi-pitfall-4/
It is extremely stupid way, but it is working - i found it by accident:
In edit query view remove the column, then save changes. You will see that in data view that column was removed as well.
Now again in edit query view remove from applied steps the action that removed the column. Save it again.
You will see that removed previously column was added to the end of the table.
This way you can arrange your columns to have it the way you want it in data view.
Hope it helped.
I don't know that you can rearrange an existing table, but if you re-create it as a new table, you can pick the order you want.
NewTable =
SELECTCOLUMNS (
OldTable,
"Column1", OldTable[Column1],
"Column2", OldTable[Column2],
"Column3", OldTable[Column3]
)
I think most here have misunderstood the problem, except #Jacko. So far as I know it is now possible to re-arrange columns in Power Query and load to the model and the table will load in the column order you specified in PQ. The problem is in dataview in the modelling layer of PBi. Here you can add many calculated columns, but, any new column you add is always placed at far right and can't be moved. Yes, I know about SELECTCOLUMNS but it isn't a solution as the new table does not have the editable formulae. A solution is a drag and drop feature of some sort. PBi users are still waiting for it despite the problem being flagged in MS Forums some years ago. No progress TIKO other than the limp SELECTCOLUMNS solution.
This is the image of the table and output required with details
So, I wrote a Django query
ModelClassName.objects.values('houseid','vehid').annotate(Count('vehid')).order_by('houseid')
This is giving me the count of each vehid but as I am not sure how to incorporate Max here, I am unable to get the right result.
Any help is appreciable.
Thanks.
Create a view to get the counts:
SELECT HOUSEID, VEHID, COUNT(*) FROM TABLE GROUP BY HOUSEID, VEHID
Then query the View
Select Houseid, VEHID, COUNT from MYVIEW A where A.COUNT = (Select Max(B.count) FROM MYVIEW B WHERE A.HOUSEID = B.HOUSEID)
Then you can use Django SQL (https://docs.djangoproject.com/en/2.0/topics/db/sql/) to help you.
(test and let me know if that worked)
I have a classic report 2 columns are coming from the table and the 3rd column is a derived column.
I want to compute the values of the 3rd column based on the value of the 2nd column like if the 2nd column value is 1 then I want to put '-' in the 3rd column if it is >1 then in the 3rd column I want to put 'More than one dates'
And I want to have filters in the 3rd column header with the values that I put, I this case '-' and 'More than one dates'
And when I select the filters I want the report to be filtered accordingly.
I have a put a screen shot of the report.
Please can anyone let me know how to accomplish this.
Any help will be more than welcome
Apex 5.1 and Firefox
Snap Shot of the Report
Your SELECT-Statement should look something like this:
select ULA_ORDER_NUMBER,
COUNT,
CASE WHEN COUNT = 1 THEN '-' ELSE 'More than one dates' END as FILTER
from YOUR_TABLE
For the filter just "double click" on the COUNT column header.
This is what it looks like:
Hope this helps you.