QListWidget with multiple row selection that looks like a table - c++

How does one create a multiple selection listbox in Qt/C++ that looks like a table?
Picture a table like this:
Sean Connery
David Niven
George Lazenby
Roger Moore
Timothy Dalton
Pierce Brosnan
Daniel Craig
such that multiple rows may be selected by clicking on them, but not parts of rows.
Something like this, by clicking on Sean Connery and Roger Moore rows, where ** indicates selection:
**Sean Connery**
David Niven
George Lazenby
**Roger Moore**
Timothy Dalton
Pierce Brosnan
Daniel Craig
I am looking at Qt documentation for QListWidget, but unclear how to do that.

Related

Filtering Slicers

I have a multidimensional cube visualized in Power BI
Imagine a fact table which has a total sales amount which is filtered using slicers. Problem is when you choose some slicer's options the chart's value showing sales amount by country falls to zero.
In other words I have some junky choices in my slicer which i want to throw away and clean them. Any ideas how to do it ?
(To add some imagery to my comment)
Make sure you have used the latest version of Power BI as some versions ago (I believe it was May) they introduced filtering of your slicer visual. See the image for an example.
Cleaning up slicers is very useful and pretty easy to do, thankfully.
To give you an example of how, and why you may do this, follow this hastily put together example.;
You have a client, Fruit Land USA that sells fruit on a grand scale. They send you data about the fruits that they sell, you clean it up and sent it back as reports.
Jackson Appleman from Fruit Land USA emails you and tells you that the reports you send out are fine, but he has a special love for Apples, for some mysterious unknown reason that isn't evident by his name.
What do?
You can throw down a slicer onto the report as you normally would, but now you see apples, oranges, pears, peaches, and bananas in your slicer. You don't want this.
So what you can do is click your slicer and drag your fruit column into the "visual filters" pane on the right, and deselect everything except for apples. Congrats, Jackson will now only be able to see data related to apples for this slicer.
But oh no, Jackson Appleman has navigated to page two. He sees data for bananas, pears, peaches, apples, and oranges. He nearly vomits at the sight of these non-appley fruits.
What do?
You can forgo the slicer filter, and follow that same path, except keep scrolling down and drag that fruit column into the "report level filters" and deselect everything except for Jackson's succulent apples.
But now John has a craving for that yellow apple data. He's tired of seeing the plain, old, cliche red apples, and the bitter green apples.
What do?
You can click the tab that says 'Basic Filtering' on your fruit column inside of the filter (whether it be on the slicer or report) and change that over to advanced filtering. Depending on your data, you can choose 'is not' and hide those boring apples. Bam, Jackson Appleman, who is becoming a real jerk at this point, no longer sees the apples he isn't specifically looking for.
I could go on and on about Jackson Appleman and his tedious requests, but I think you get the point. I hope this helped you. Otherwise, I hope learning about Jackson Appleman was good enough.

Using Different, Aggregated Column as Column Name in Slicer

I'm new to Power BI and trying to create a slicer for Classes by Instructor. The best value to display to the user is the name, since that is how users normally identify the instructors. The problem is that some instructors have had name changes. This actually leads to two problems:
1. How to roll the duplicates up into one item in the slicer selection options, and
2. How to use the combined underlying DimIDs for actually slicing the data.
Sample source table structure looks like this:
InstructorDimID InstructorID InstructorName
--------------- ------------ --------------
1 1 John Smith
2 2 Karen Jones
3 2 Karen Watson
4 3 Jennifer Anderson
5 3 Jennifer Hancock
Would like the slicer to look like this:
Jennifer Hancock
John Smith
Karen Watson
I have an idea of how I would do this in SQL but don't know if it's at all relevant for Power BI. I tried searching stackoverflow as well as Power BI sites with no luck; am looking for an approach that will help me learn how to "think in Power BI". Any tips are much appreciated.
This has to be a part of your data model.
Either add a new table keyed by InstructorID that has the current name of each Instructor, and a relationship with filter flow to your existing InstructorDim, or add a CurrentName column to your existing InstructorDim.

Concatenation of detail values in PowerBI

I am designing a PowerBI report using DirectQuery on a database.
In the database I have tables for persons, languages, and a link table telling which language a person speaks.
Example:
Persons
-------
Anna
Jane
John
Luis
Languages
---------
English
French
Spanish
Persons_Languages
-----------------
Anna English
Anna French
Jane English
Jane French
Luis English
Luis French
Luis Spanish
I would like a report in PowerBI of the most common languages combinations. For example, in this case both Anna and Jane speak English+French, while Luis speaks English+French+Spanish. The desired report would show:
English+French 2
English+French+Spanish 1
Since I am trying to learn PowerBI, I need to exclude any solution at the database level.
Yes, Alexis Olson is right, working with direct link, can't allow you to build measures/calcolated tables on data.
You have here 2 choices:
1- change from direct link to import and then build your ad hoc measure/table
2- directly build your measure on the source database, and then access the table from PBI
Good luck ;)

SAS Proc Report Specific Setup

I want to use proc report to build a display instead of simple proc print. My data look like this.
A B C D
Bill Harry Bog The
Bill Harry Hog Quick
Bill Harry Log Brown
Bill Hermione Bog Fox
Bill Hermione Hog Jumps
Bill Hermione Log Over
Bill Ron Bog The
Bill Ron Hog Lazy
Bill Ron Log Dogs
Ted Harry Bog Peter
Ted Harry Hog Piper
Ted Harry Log Picked
Ted Hermione Bog A
Ted Hermione Hog Powerful
Ted Hermione Log Peck
Ted Ron Bog Of
Ted Ron Hog Picked
Ted Ron Log Peppers
And I want the final output to look like this:
A B Bog Hog Log
Bill Harry The Quick Brown
Hermione Fox Jumps Over
Ron The Lazy Dogs
Ted Harry Peter Piper Picked
Hermione A Powerful Peck
Ron Of Pickled Peppers
All variables are character.
How do I set it up in proc report? I get close with the various combinations of group, across, etc, but I never seem to get this exactly. I'm a novice to proc report, any help appreciated.
Next time post your tried Proc REPORT code so we can get an idea of how you are thinking.
Use the comma operator to stack columns c & d and a hidden statistic to force the stacking.
proc report data=foo;
columns a b c,d n;
define a / group;
define b / group;
define c / across;
define d / display;
define n / noprint;
run;
Recommended reading: Sailing Over the ACROSS Hurdle in PROC REPORT.
Cynthia L. Zender, SAS Institute Inc., Cary, NC

grouping column in google data studio

I have example data:
customer_list:
Name suburb
Cersei king-landing
Jamie king-landing
Jon winterfell
Arya winterfell
Sansa winterfell
Dany westeros
in google-data studio, what is the best way if I want to create pie chart based on total people live in suburb.
So, from my example it should be
Winterfell 50% of pie chart
king-landing 33 % of pie chart
westeros 16% of pie chart
I have some research, such as
https://datarunsdeep.com.au/blog/custom-content-grouping-data-studio
but it doesnt make sense to me, because we need to create each group. what if I have 1000++ suburbs?
I have just started to look into this product today by the way. Apologise if I don't know too much about this yet.
This does the trick:
Chart Type: Pie Chart
Dimension: suburb
Metric: suburb (Aggregation: Count)
Google Data Studio Report and a GIF to elaborate:
I'm also looking at DataStudio for the first time, so apologies if this is off the mark, but would the following work?
Click 'Add a Metric', then 'Create New Metric' (named whatever you want - for this example a nice intuitive suburb_count) and have this set to COUNT(suburb).
Then, create a pie chart with suburb as the dimension and use the suburb_count as the metric to measure this against?
Hope this gets you in the right direction. Let me know - interested to see if this worked!