Dynamically increasing or decreasing percentage using parameter action in tableau - data-visualization

I’m stuck with a calculation here I created a parameter action I’ll like users to be able to adjust price for example a parameter where users change the percentage using the parameter they’ll see how much we could potentially make so basically I need a calculated field that dynamically changing price increase or decrease ,how can I do that?

Sounds like a case for a parameter, not a parameter action. Create a parameter with Integer data type, which the users can change, and build a calculated field from that.
Assuming you have a field called [Price], create a calculation such as:
SUM([Price])*(1+([IntegerParameter]/100))
Note this isn't tested so please check it.

Related

Rows Are Duplicated in WEBI Report

WEBI Report is created with a structure, so I cannot modify the cells one by one but I need that.
I use [Things] where ([Things]="Thing") etc. in cells. However it looks like this, the rows are duplicated for a reason:
but i want this:
any help is appreciated.
ps: i cannot give the actual data cause its a customer's report.
In your example case, it's not obvious what you want because your starting data is not clear. It's also not obvious where the #MULTIVALUE sits in the block, i.e. as a sub total. If it is a subtotal, then it suggests that [Quantity] is not defined as a measure. If that is the case, =Sum( whatever is in the multivalue cell ) will fix that, assuming it is a number and not text held as a number. If it's text, then create a new variable, called say, NumericQuantity, as =ToNumber([Quantity]) and use that instead.
Without knowing the actual structure of the block, that's the best advice that I can offer.

Access: Workarounds for updating data in not updatable query?

tldr: Can not update records from query because of aggregate functions. What workarounds do you suggest?
I have a table containing decision criteria to which a user can assign a relative weight. I calculate the absolute weight in an SQL query using an aggregate function (as described here Divide the value of each row by the SUM of this column).
qryDecisionCriteria
name relative_weight absolute_weight (calculated)
price 2 50 %
quality 1 25 %
experience 1 25 %
I would like to present the query result in a form, where the user can update the relative weights, and then sees the absolute_weights.
However, the query results are not updatable, because the query involves an aggregate function.
What alternative methods or workarounds could I use, so that a user can edit relative_weights and view absolute_weights as a kind of visual feedback?
I read about temporary tables here http://www.fmsinc.com/MicrosoftAccess/query/non-updateable/index.html but I'm not sure, how to implement this.
Maybe I could also create an additional "edit form" based on a simple query, that is automatically invoked when the user selects a record in qryDecisionCriteria data?
Or maybe just display data from two queries (one updatable, one with the calculated field) next to each other in the form?
Which options would you recommend and why?
Make the Record Source for the form the updatable base query. In the text box which shows the calculated absolute weight set the control source to
=DSum("relative_weight","<base table name>")/Forms!<Form Name>!relative_weight
You'll need to be sure that you do two things with this
When you drag fields onto a form in Access it makes the name of the control the same as the control source column. this is really annoying and can cause a lot of headaches. Rename your control to something like txtColumnName. That way Forms!<Form Name>!relative_weight is guaranteed to reference the field and not the textbox.
in the AfterChange event for the relative_weight textbox you should add an event handler in which the following code is run
txtabsolute_weight.Requery
This will make sure the formula is recalculated whenever someone changes a weight. Otherwise they need to hit F5.

Creating a Calculated Field between 2 datasets in SSRS 2008 R2 Express

I have a very simple task. I have two datsets. The first is a single value that has returned me a number of calls that has been made. The second is a list of targets. I want to be able to divide the first number of calls by its call target in order to calculate the total %.
The lookups of these are dependant on the criteria that is selected in the report itself. I know it's possible to do inside SQL its just a huge pain in the ass. I want to be able to calculate two fields and I thought something so simple would be a breeze for SSRS but apparently not. So the error i get is:
*The expression used for the calculated field'=fields!DMCP.Value / FIRST(Fields!DMCTarget.Value,"AllTargets")' includes an aggregate,rownumber,runningvalue, previous or lookup function. aggregate,rownumber,runningvalue, previous and lookup functions cannot be used in calculated field expressions.*
I can take the first function out but it doesn't help me. It says it can only calculate in the same dataset, problem is these values can never co-exist in the same dataset. Anything I can do????
Thanks in advance

How to use query for grid\enhancedGrid?

I want to sort information in a dojo EnhancedGrid (connected to database through JsonRestStore). I know dojo grids provide functionality to sort based on a single column. However, in my grid, one column contains combined information from multiple fields (e.g., last name, first name, email, age) of database table. Is there a simple way to sort the grid or the data in the store based on a single filed in database table (e.g., last name)?
It seems I can use "query" to change the view of the store (grid is a view of the store if I understand correctly), but I don't understand how to write a query to do that. Can anyone give me more information about the syntax of using query or how to solve this issue?
Thank you!
It looks like you have to use what is called a comparatorMap for customized grid sorting.
here's one example :
http://www.ibm.com/developerworks/web/library/wa-aj-dojogrid/index.html
(look for the section 'Listing 15. Customize the sort function of Dojo
Grid')
inside the comparator map function is where you would convert the strings to
numbers and make the numeric comparison.

Create a report that could be one page or two, depending on what field was modified

In an alternate application, the user has the ability to update their address and phone number. When these are changed, three fields will update: Old Value, New Value, and Field Changed. If the Field Changed was the address, I need to create two report pages - one with the old address and one with the new. However, if the Field Changed was the phone number, I only need to create one report page for the current address.
My initial plan was to do a Union that would have one record with the Old Value and another with the New Value. This should work when only the Address has changed. However, it won't whenever the Phone Number has changed. I assume I need to do some sort of case statement, but I'm not really sure if this is the right approach. Sorry if the data is a little confusing (I didn't design the data structure. This was provided by our professor's assistant). If you need more information, I'll try to provide it.
I'm not looking for exact SQL, but I am wondering if I'm approaching this the correct way.
What do you mean by a 1 or 2 page report? Are you outputting to a CSV, PDF, XLSX or something eles?
If you need to do this through "pure" sql I would recommend a stored procedure that is given a value stating whether it's the address or phone number that is being updated. It can then do the update and you can simply do an if statement which determines which report to run and return.
I'd recommend handling it programatically if possible. Have your code run the sql update and then call the appropriate function within your code to get the report you need. You can then easily re-use the code for that report in other ways.