Visual fox Pro 9. Combo box usage for address - visual-foxpro

How can i create 2 combo box that is linked for address usage.
I have a table named Places with 2 fields. Region and city.
The first combo box drops down the list of regions and when i picked one
the next combo box results the cities in that regions.
how do i do that

Use RowSourceType=3 (SQL) for both. RoWSource properties then look like:
select Region, RegionID from Regions order by Region into cursor crsRegions
select City, CityId from Cities where RegionId = crsRegions.RegionId order by City into cursor crsCities
In valid or InteractiveChange of region combo call require of cities combo ( cmbCities.Requery() ).
That is it. You get the selected values (or any field's value you need) using the alias.field syntax like crsCities.cityId.

Related

Highlighting with slicer Power BI

I have a Dashboard with different visuals.
Data is made up of different values for insurance companies.
I want my slicers/filters to not filter all data, but to only highlight the chosen company.
For example, in my slicer I choose the insurance ABN.
Instead of showing me the value for ABN only in my visuals, I want all other values to still be visible and ABN's value to be highlighted in the visuals.
Does anyone know how to do this?
You can use conditional formatting to achieve this. Lets say that we will change the background color to "highlight" a row (or cells, to be precise).
First, we need a slicer, which will not filter our data. We can do this by duplicating our source table, removing the unnecessary columns and making sure there is no relationship between the source and the duplicate. So if we have a source table, named Table, like this:
Right click on it and select Duplicate:
Then right click the title of the column you want to keep and select Remove Other Columns to get a list of company names only (you may also remove the duplicates, but it's not required). Then in the model delete the relation between both tables:
Now you can place a table showing company name and sales from your data source, and a slicer for company name from the duplicate table. At this point selecting values in the slicer should not affect the table.
Now you need to capture the value of the slicer and use it in a measure, which will determine should current row be highlighted or not. You can use SELECTEDVALUE for that, but note that it will give you a value only if there is a one selected in the slicer. If you want to support highlighting of more than one company, it gets a bit more complicated.
Make a new measure in your source table, like this:
Measure = IF(HASONEVALUE('Table (2)'[Company name]);
IF(SELECTEDVALUE('Table (2)'[Company name]) = MAX('Table'[Company name]); 1; 0);
IF(ISFILTERED('Table (2)'[Company name]) && COUNTROWS(FILTER('Table (2)'; 'Table (2)'[Company name] = MAX('Table'[Company name]))); 1; 0))
In case there is only one value selected in the slicer (see HASONEVALUE), then our measure will return 1 (highlight) or 0 (don't), comparing it with the current row.
Otherwise (i.e. there is no selection in the slicer, or there are 2 or more companies selected), then we will look at the filtered list of companies (Table (2)) - if it contains current row, then 1 (highlight), otherwise 0 (don't). But we will also handle the case, where there is no value selected in the slicer. In this case the list will contain all the companies, i.e. all rows will be highlighted. Here comes ISFILTERED. And at the end, if the list is filtered and current row exists in the filtered list, then 1 (highlight), otherwise 0 (don't).
Now, you need to use this measure to change the background of the column - right click each column in your table and select Conditional formatting -> Background color:
Then format by rules, where Measure >= 1 like this:
Now, when there is no selection in the slicer, there are no rows highlighted in the table:
If you select one company, it is highlighted:
It also work if there are multiple companies selected:
Thank you Andrey for your step-by-step explanation which as been incredible helpful. I'd like to follow up with a further question, particularly regarding the comment below.
"You can use SELECTEDVALUE for that, but note that it will give you a
value only if there is a one selected in the slicer. If you want to
support highlighting of more than one company, it gets a bit more
complicated."
In my model, I've linked a third table (Table (3)) to Table (2) with a many to one relationship with Table (2). Therefore when I click on Table (3), it will filter Table (2), which acts as a slicer for Table (1).
When only 1 value is filtered in Table (2), it conditionally formats the cells in Table (1). However, when more than 1 value is filtered in Table (2), conditional formatting fails.
As I'm looking to avoid manually selecting multiple values in the slicer (Table (2)), I was wondering if there's a workaround for SELECTEDVALUE such that it is able to conditionally format when I filter more than 1 value in Table (2).

Create DropDowns that are based on which criteria are searched for

I am trying to allow the user to search on any of 4 criteria and have the rest of the 3 remaining field data validate based on the first search for selection.
I have four fields that I am trying to make dependent drop downs for the remaining 3 based on what you search for 1st. For example:
Scenario 1 - I search the data range validation for NAME and select a name in Cell L2.
I want the Phone, Email and Address to become dependent on the name was chosen (as there may be multiple records with the name of the person chosen).
I have accomplished this by using a secondary filter formula to filter address based on the name chosen and then applied data validation from the filter.
My problem is that I can't seem to figure out how to do the same thing if they pick the address first. Because my data validation is set on the filtered values and not the entire database. If they picked the address first, I want to validate based on ALL addresses and then filter-validate the NAME, PHONE and EMAIL.
I really just want them to be able to search whatever of the 4 criteria and then validate the other 3 on that result.
Any thoughts would help.
You can see my formula for filtering Addresses based on the Name selection in Cell S2 of the Customer Record Tab.
=if(L6="Address",filter('Sample Data'!$C:$C,'Sample Data'!$E:$E=L6),IF(L6="Phone",filter('Sample Data'!$C:$C,'Sample Data'!$D:$D=L3),IF(L6="Email",filter('Sample Data'!$C:$C,'Sample Data'!$J:$J=L4),L2)))
https://docs.google.com/spreadsheets/d/1E7adi88aEgvdV4ao8unbMHgZLEyu5CCRdTOjv8thjtc/edit#gid=1427488050
Select Name and only the Phones, Emails and Addresses for that selected name can be selected.
Select the Address and only the Names, Phones and Emails for that Address can be selected.
Same for Phone and for Email

How to filter out parameters value in SSRS

I currently have a SSRS report which is giving me Telephony Data based on two sites, Cape Town and Dallas.
At present I have a parameter called Site and a parameter called Data_Label. It works absolutely how I wish by selecting Cape Town and the relevant Data_Label and the same for Dallas. This then shows all the data I need.
The issue I have is that there is a very long list of Data_Label's, half are attached to the Cape Town site and the other half to the Dallas site. What I would like to have happen, is when I select Cape Town as my site, half of the Data_Label's appear and then when I select Dallas the others will then show.
This is my current query in the Dataset:
WHERE ([LB ODS].Telephony_LifestyleBenefits_VIEW.Site IN (#Site)) AND ([LB ODS].DataLookup.Data_Label IN (#DataLabel))
So each Data_Label will be linked to it's relevant site in the main database but I just need a filter in my parameter so that it doesn't show the long list
Thanks
Dan
You can cascade Data_Label parameter from Site parameter value.
If you populate Data_Label parameter via a dataset you can filter the available values using the Site parameter, something like this
select Data_Label
from Table1
where Site IN (#Site)
When you run the report the dataset that populates the Data_Label parameter will run the above query and return the Data_Label values related to the value selected for the Site parameter.
Also if you populate the parameter manually you can hardcode the values in a CTE what results in something like this:
WITH DLValues AS (
select 'Data_Label1' [Data_Label], 'Dallas' [RelatedSite]
union all
select 'Data_Label2' [Data_Label], 'Dallas' [RelatedSite]
union all
select 'Data_Label3' [Data_Label], 'Cape Town' [RelatedSite]
union all
select 'Data_Label4' [Data_Label], 'Cape Town' [RelatedSite]
)
select Data_Label
from DLValues
where RelatedSite IN (#Site)
Let me know if this helps you.

How to pick the values from two co-related dropdown in jmeter?

In my case, there are two drop down mainly displaying cities & branches,
suppose I select City1 from select city drop down then select branch showing Branch10, branch11, branch13 values.
Suppose i select City2 from select city drop down then select branch Drop down showing Branch20, branch21, branch23 values.
Now i want to select Random city from first DropDown & Random branch but corresponding to selected city bucket.
Please suggest.
While you have selected any city from City dropdown then there must be a ajax call generated during recording of your script.
So first of all correlate value for city from previous responses and store into one variable, let say City and pass match number as 0 in regular expression extractor for selecting random values, now pass this city into the request as ${city} and in response you must be getting options for branch (depending upon the city which you have entered) now corelate this also and pass match no. as 0 and use it in following requests.

Dropdown with Checkbox in SSRS

I have a report in SSRS which is generated for around 50-60 items.
Say, the report shows Country name on one scale and their population on another.
When the graph is generated, it shows around 100 countries.
If I want to see population of only UK, US, India and China. Then I Should have an option to select the countries of my choice.
Having one dropdown and allowing them to select only one country at a time is simple.
I have no idea on how I can have a checkbox in dropdown to allow multiple selections.
TIA.
You'll want to search for Multi-valued Parameters. If you open the properties of the parameter there will be an option something like "Allow multiple values". Reporting services will handle the UI with checkboxes.
One important thing to know about multi-valued parameters is how to use them in your query. Suppose your parameter #CountryId is being filled with this query:
SELECT CountryId, -- This will be the value for the parameter
CountryName, -- The label for the parameter
FROM Country
If you set this parameter to allow multiple-values, reporting services will generate the multi-select UI for you. When executing any subsequent query that uses the parameter, before sending the query to your SQL server it will replace the parameter with a comma-seperated list of CountryId values. So this query:
SELECT *
FROM MyDataTable
WHERE MyDataTable.CountryId IN (#CountryID)
Will be sent to SQL server as something like this, supposing there are 3 countries selected:
SELECT *
FROM MyDataTable
WHERE MyDataTable.CountryId IN (1001,1002,1003)

Resources