I have a csv file with multiple lists. See picture. What I want to do is query every single value so it tells me which list that the value is found in.
Eg I query number 898774 and it tells me 898774 - prim6 in set 1, set 2 and set 4.
I did find a quick work around by making one big list in excel, removing dupes and then manually searching all for each number. Doable for a small amount but not that good for '000s of sets.
I created a vector for each column and started a search with which(sapply) but then remembered I needed the names. Just a little bit out of my knowledge.
Im a trainee working with databases.
Im working on PowerBI report based on SQL query where all of the needed joins are included for my data to be obtained. So Im working within one dataset.
I have made a table where I can show number of transaction(like invoice number) and name of person that made that transaction. My problem lies in creating a measure that will influence that table. It should work like a having clausule from SQL (well at least my boss said that).
I would like for this measure to force this table to show only data for people that have made more than 2 transactions (they have more than 2 invoice numbers [so there are more than two rows for this person]) .
I tried to do it by writing a measure like that:
Measure = COUNTAX(
Query1;counta([Salesman])>2)
Or like that:
Measure 2 =
FILTER( Query1; counta(Query1[Salesman])>2 )
But i only got a bar graph that is showing me how many transactions were made by each person. When Im adding this measure to this table i see that for each row i got value 1.
Im new to the PowerBi and DAX so it's quite a big hurdle for me. Can someone share his/hers knowledge to help solve this problem? I would be much obliged.
I found a solution for my problem.
I created a second query that counted transactions for each person with their names. I created relationship between my two queries. Next I added counting attribute to my table with data from query one and I used filter on my counting attribute. After that this attribute can be just hidden and It works perfectly.
On top of that I created a measure and made a chart using this measure. It looks nice and clear.
The measure looks like that:
Measure =
COUNTAX(
Query1;counta([Salesman])
)
I filtered this measure too to get wanted result.
I've 2 QStandardItemModel where the first model holds data and the second one holds a summary of that data (earnings per day on 1st model and earnings per week on the 2nd. Each row is a productive unit and each column is a day/week).
Both models appear on separated QTableView and I'd like to be able to sort one model and affect the other, so the data of both models would always correspond to the same productive unit.
I want the user to be able to see daily data (and scroll through it) while seeing the weekly data at the same time, which is why I don't make a single model.
Currently, I'm using a QSortFilterProxyModel to handle the sorting, but that doesn't sort both models at the same time.
How can I sort them at the same time?
I found no solution for this problem. Instead I sorted it by choosing a less-than-ideal single QTableView. I'm thinking of allowing the user to set a max of summary columns to avoid them from overflowing the table (I haven't gotten to that yet).
Anyways, I just wanted to say that I consider this question abandoned
I need to produce a Cognos Report that produces 12 tabs. Each tab contains the same sort of report simply run for a different parameter value, for example, the month of the current year. I would like to reuse the SQL and define it only once and have this SQL accept a parameter.
I'm very new to Cognos 10 Report Studio. Can I use the Event Manager to execute a single report once with 13 parameters but yet combine the results in a sdingle XLS with 12 tabs?
I know I can split the results of a single query across multuiple XLS tabs, but i need to run the same query multiple times with different parameters...
I've only seen a 5 min demo of Event Mgt, not sure if that's even the place. Any direction to a newbie would be appreciated.
Depends on how "different" the parameters are.
If you want to split the values of one data item across separate tabs, such as a tab for each month of the year, use Page Sets. Write one query, create one list/report object. Then Section the list and tie to the Page Set construct in the Page tab. Example
A report created in Report Studio with different Pages will also export to different Excel tabs. If you have to split on a combination of 2+ data items with different values, you'll have to use different pages and queries. You can't re-use one query and plug in different values for each page. So, copy the primary query object and re-write to use parameter(s) unique to each page. Your prompt page may get a little large, but this is the standard method to create a "book" of reports.
Event Manager is for triggering report execution based off changing data. The classic example is to send a "Thank You" note to a salesman when he logs a sale of $1m or more in the database.
I'm fairly new to Tableau, and I'm struggling in building some routines that could be easily implemented in Excel (though it would take forever for big sets of data).
So here is the deal, consider a dataset with the following fields:
int [id_order] -> id of the sales order (deepest level, there are only unique entries of id_order)
int [id_client] -> as I want to know who bought it
date [purchase_date] -> when the customer bought the product
What I want to know is, for each order, when was the last time (if ever) the client has bought something. In order words, what is the highest purchase_date for that user that is smaller than current purchase_date.
In excel, approach is simple (but again, not efficient)
{=max(if(id_client=B1,if(purchase_order
Is there a way to do this kind of calculation in Tableau?
You can do this in Tableau using table calculations. They take a little time to understand how to use well, but are very powerful and flexible. I posted a sample Tableau workbook for a similar question in an answer for SO question Find first time a condition is met
Your situation is similar, but with the extra complication that you want to repeat the analysis for each client id, so you might want to try a recursive approach using the Previous_Value() function instead of the approach used in that example - though I'm not certain that previous_value() will fit your situation.
Still, it might be helpful to download the example workbook I mentioned to get an idea how table calculations can address similar problems.
Just to register the solution, in case someone has the same doubt.
So, basically the solution I found use table calculation, which is not calculated until it's called on a sheet (and is only calculated on the context of the sheet). That's a little bit limiting, so what I do is create a sheet with all the fields I need (+ what is necessary for the table calculation) then export the data (to mdb) and connect to this new file.
So, for my example, the right table calculation is (let's name it last_order_date):
LOOKUP(MAX([purchase_date]),-1)
Explanations. The MAX() is necessary because Lookup (and all table calculations) does not work with data directly, only with aggregations. You can use sum, avg, max, attr, whatever suits you. As in my case there will be only 1 correspondence, any function will do just fine and return the same value.
The -1 indicates that I'm looking for the element immediately before the current entry (of the table, as you define it). If it were FIRST(), it would go for the first entry of the table, and LAST() would go for the last.
Now, I have to put it on a sheet. So I'll bring the fields id_client, id_order, purchase_date and last_order_date.
Then I have to define the parameters of my table calculation last_order_date (Edit Table Calculation). I'll go to Compute using and choose advanced. Now I'll do Partitioning: id_client, and addressing all the rest. What will that do? This mean Tableau will create temporary tables for each id_client, and table calculations will use those tables as parameter.
Additionally, I will Sort by field purchase_date, Max (again the aggregation issue) and ascending, to guarantee my entries are in chronological order.
Now, what will it do? For each entry it will access the table of the id_client, and check what was the purchase_date that is immediately before the current entry (that is being assessed), exactly what I need.
To avoid spending Tableau processing in Visualization, I often put all the fields in details (and leave nothing on screen), use Bar chart (it's good because it allows me to see the data). Then I export it to mdb, then connect to it again. Unfortunately Tableau doesn't directly export to tde.