I have to display tabular data whose structure (columns and headers) changes depending on an ID. For ID "A" I would get columns "Name|Address|valid" but for ID "B" I would get "Name|Birthday|Sex|".
The dynamic structure would be implemented by a stored procedure that returns different tables based on the ID.
Is it possible to create a generic report based on this?
In the report I would like to be able to filter based on the columns like one is used to from Excel. Also the headers of the columns would be dynamic ...
If you are using Qlikview 11, you can use conditional show/hide for each dimension/expression in charts.
Use an expression like
GetFieldSelections(ID) = 'A'
in the condition section of the chart properties for the other dimensions
If you are using QLikSense, you can do this through the API but it seems it breaks the purpose of QlikSense (which is pure adhoc discovery as compared to guided analytics of Qlikview 11).
If you are using Qlikview 10, you can do this by saving the expression in a variable and calling the variable in the dimension of your chart.
Related
My issue is similar to this one Multiple data types in a Power BI matrix but I've got a bit of a different setup that's throwing everything off.
What I'm trying to do is create a matrix table with several metrics that are categorized as Current (raw data values) and Prior (year over year percent growth/decline). I've created some dummy data in Excel to get the format the way I want it in PowerBI (see below):
Desired Format
As you can see the Current values are coming in as integers and the Prior % numbers as percentages which is exactly what I want; however, I was able to accomplish this through a custom column with the following formula:
Revenue2 = IF(Scorecard2[Current_Prior] = "Current", FORMAT(FIXED(Scorecard2[Revenue],0), "$#,###"), FORMAT(Scorecard2[Revenue], "Percent"))
The problem is that the data comes from a SQL query and you can't use the FORMAT() function in DirectQuery. Is there a way I can have two different datatypes in the same column of data? See below for how the SQL data comes into PowerBI (I can change this if need be):
SQL
Create 2 separate measures, one for the Current second for Prior, and format these measures.
Probably you can also use a case in SQL query to format your data to bring it as STRING.
What I wound up doing was reformatting the SQL code to look like this:
Solution
That way Current/Prior are have two separate values and the "metric" is categorical.
I got the idea from this post:
Simple way to transpose columns and rows in SQL?
I am trying to create a new mobile report using the SSMS 2016 SQL Server Report Publisher. Each time I try to create a new graph using the data from my data source, SSMS doesn't recognize any metrics to display on the graph. It appears that each of my columns have a filter-esque symbol next to the text, prohibiting me from using that column as a metric. How can I alter my data to remove this symbol and furthermore, what does this symbol represent?
Visual Example:
Answer: You cannot analyze data that is not aggregated. For example, the data in your data tables must be either be evaluated through the count function, sum function, avg function, etc. or else it cannot be used in the reporting services.
From what I've seen, the data types are important to your metric that you want to plot must be a numeric/integer/money data type.
We need to create several reports but they all have the same exact layout. Rather than creating many reports, is it possible to create a single report that can conditionally be populated by different sets of data?
For example, say the report is a simple list of customer names and addresses. I would like to have a parameter that asks for a customer type. A second drop down parameter list would only show customer subtypes directly related to the parent customer type. Can a parameter drop down be filtered based upon a selection in another parameter drop down?
What other ways can I manage a single report layout but populate with different sets of data based on parameters?
is it possible to create a single report that can conditionally be
populated by different sets of data?
Yes, it is possible as long as the multiple data you use fits the structure of your report. Using parameters you can populate your report with different data.
Can a parameter drop down be filtered based upon a selection in
another parameter drop down?
Yes, A parameter can be populated based on other parameter selection. There are a lot of resources in the web that ilustrate how to achieve that functionality. Give a try and if you get stuck we are here.
What other ways can I manage a single report layout but populate with
different sets of data based on parameters?
You can select the data in your report by using multiple parameters and a single dataset. Then using SQL statements and parameters you can filter from where clause or create a flow in multiple select statements using T-SQL. Something like
IF #my_param = 1
BEGIN
select ...
END
ELSE
BEGIN
select ...
END
Let me know if this helps you.
We are using Excel 2013 and Power Pivot to build modules that consist of several Pivot tables that are all pulling data from the same Power Pivot table, which queries our T-SQL data warehouse.
In an effort to simplify and fully automate this module, we wanted to create a text field that would allow a user to enter a value (a client ID# for example), and then have that value be used as a parameter in the Power Pivot query.
Is it possible to pass a Parameter in the Power Pivot query, which is housed in a text field outside of the query?
You can also pass a slicer or combobox selection to a cell. Define a name for that cell. Put that cell (and others if you have multiple text variables to use) in a table. For convenience, I usually name this table "Parameters". You can then 'read in' the parameters to your query and drop them in your query statements.
The code at the top of your query to read these parameters in might look like...
let
Parameter_Table = Excel.CurrentWorkbook(){[Name="Parameter"]}[Content],
XXX_Value = Parameter_Table{1}[Value],
YYY_Value = Parameter_Table{2}[Value],
ZZZ_Value = Parameter_Table{3}[Value],
Followed by your query wherein instead of searching for, say a manually typed in customer called "BigDataCo", you would replace "BigDataCo" with XXX_Value.
Refreshing the link each time a different customer is selected will indeed be a very slow approach, but this has worked for me.
Rather than pass a parameter to the data source SQL query, why not utilize a pivot table filter or slicer to do allow the users to dynamically filter the data? This is much faster than refreshing the data from the source.
If for some reason you need to pass this directly to the source query, you'll have to do some VBA work.
I am using RavenDB to store data in documents which I want to query later dynamically for generating some visual charts. I have an ASP.Net interface where the user can apply filters, include exclude certain criteria. This is a normal requirement in search pages and I thought RavenDB is perfect for it. However I am not sure how to generate the filters dynamically, do I need to create index on all fields in advance?
In one thread I read about LuceneQuery but there is no simple example out there documenting how to apply and remove filter criteria dynamically via LuceneQuery.
Kindly help and suggest how I can implement it. With Entity Framework I simple used to build the expression dynamically based on some values and then pass it in where clause.
Update: Ok so to be more specific I have a page where I am generating charts using dynamic queires. User has multiple filters that he can modify like, Year From, Year To, Category, Sub Category, Sales By Specific Salesman etc.
All this data is stored in one table or document so to speak. I want to group data based on user filters which can only be determined at run time, then execute a query that fethches result using "AND" operator among the filters. So that only those records that exactly match the criteria (Not the scores that Lucene calculates during search) are grouped and summary is returned so that I can generate charts on them. Hope I made sense this time