Dynamic formula field with selected picklist - salesforce

I am a newbie and I need little help, I have 2 picklists and based on the selection of the values of picklists I need to generate a dynamic calculated field on page. I know it is not possible using formula custom field, if it can be done using apex can anyone suggest me how with some sample code? Thanks.

It'll depend on how many combinations you have in your two picklsits. If they're up to 5 each (for instance) you could do this in a formula field quite easily with a nested IF or a CASE statement if you concatenate the values together. Something like this:
CASE( Contact_Type__c & LeadSource , 'CustomerCampaign', 'Customer originated from a campaign, 'SupplierCampaign', 'Supplier originated form a campaign',...,else_result)
If there are lots or combinations/permutations then a trigger might be a better solution.

Related

How do I achieve this output in a Google Data Studio report, given the raw data?

I have a small set of test records in Google Data Studio and am attempting to create a table that gives me breakdowns of particular values relative to the total number of values, by dimension. I think the image here below describes the need clearly. I have tried using an approach I saw online entailing creating a calculated field like this:
case when Action = 'Clicked' then 1 else 0 end
and then creating a metric based upon that field, which does the 'Percentage of Total - Relative to Corresponding Data' but this produces incorrect numbers and seems really cumbersome (needing one calculated field per distinct value). My client wants this exact tabular presentation, not a chart(s).
How do I achieve the desired report?
Thanks!
Solution entails creating fields like 'Opened' which outputs 1 when Action = 'Opened', 0 otherwise. Then create fields like 'Opened Rate' with e.g. sum(Opened) / Record Count. Then set those as percentages.

Alternative for a Nested Aggregate as a group filter SSRS

I have a report that needs to get only the top 10 of that category and sort it from highest value to lowest having this kind of expression:
=Sum(Sum(Fields!Measure.Value, "RowGroup1"), "RowGroup2")
But the problem is, the only filter that SSRS accepts is the simple aggregate:
=Sum(Fields!Measure.Value)
Not using the nested aggregate will give the wrong top 10.
Another thing, the client is using Analysis Services as the connection for the report so I cannot tweak the dataset by using a query. The fix should be inside SSRS. Is there anyway to do this? Please help me.
Please try using Top N filter from the chart properties. You might want to sort the values before using the filter.

MsAccess - How to make an ID field fill in other fields in the form?

Problem:
I'm trying to make it so when a numerical field is filled in with a certain ID it fills in the other fields accordingly to what the first field was filled with. So if a person were to type in their ID it would populate it with their name accordingly.
Example:
But upon ID/numerical change I want it to do something like this:
Prior knowledge that may or may not help:
-I know this is possible with combo boxes but having a combo box with 2k-8k entries seems absurd
-I don't really think subform is optimal for this situation
-I think you can do this with "=DLookup" but I don't exactly understand how to pull it off
Please and thanks for any help. All is appreciated greatly!
Some built-in Access mechanisms:
Search field in the Navigation bar of the form.
Find feature (Ctrl-F).
Alternatively, with VBA you can use your own UI design and have more control:
Obtain the desired ID from the UI in whatever way you like - a textbox, a button and a popup, etc. Don't use a textbox that is bound to the actual ID field (ID fields should be read-only and you shouldn't use an edit field for a search field - keep them separate).
In VBA, obtain the ID that user searched for and then jump to that record using code like this:
Me.RecordsetClone.FindFirst "StudentID = " & studentID
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
You don't need VBA for this. Simply add the Student ID textbox value as a parameter the form's query and let it filter the results according the ID provided.
The query should be something like this:
PARAMETERS [Forms]![YourMainForm]![YourIdTextBoxName] Long;
SELECT *
FROM YourTableName
WHERE ((([Student ID])=[Forms]![YourMainForm]![YourIdTextBoxName]));
When you add a new ID, requery the form to see the results.
Me.Requery

Is it possible to create a parameter query in openoffice base?

In access it is very easy to use it:
BETWEEN [minimum] AND [maximum]
But what is the syntax in openoffice base?
There are two ways to do this. First is to have the query ask for user input. Colons are used to indicate user-input parameters, like this:
BETWEEN :MINIMUM AND :MAXIMUM
Second is to use a one-row filter table. Tie the user's form to this one row by making the form source something like SELECT * FROM "Filter" WHERE "FilterID" = 1. Then the user will enter the dates into the filter table, and the query will have a join to the filter table to determine the dates.

QlikView : get data filtered in pivot table

I found a great tutorial for building a nicer (dynamic) multibox, without extensions.
I was able to use it, and I really love it.
However, I have an issue:
if I use a multibox with a master detail table, then if I filter it from detail then master will automatically selected. The below example shows a normal multibox at the top, and dynamic/pivot multibox at the bottom:
How I can achieve this with my dynamic multibox?
For the label, I use:
=if(IsNull(GetFieldSelections(master)) = -1, 'Master',GetFieldSelections(master))
with this, I can set 'Master' as the label.
I can see data has seen filtered but I didn't find a function to get data that has been filtered to set it in the label, maybe someone here can give me an advice to solve this.
The GetFieldSelections() will only give you the list of explicitly selected items. By selecting items in the detail, you're only selecting from the master implicitly.
Try using Concat() instead. This will give you the list of possible values for a field that isn't being directly selected upon.
Your next big headache will be how to determine when to show 'Master' or not. One possible method is to compare the full list of possible values in Master to the possible list. In the example below, I do this by comparing the possible count of master count(master) with the full list of possible values in master count({1}master).
Combining these, one solution could be:
=if(count(master)=count({1}master),'Master',Concat(master,', '))

Resources