How show conditional sum using multiple dataset? - reportviewer

I need show on my reportviewer the conditional sum getting data of other dataset, because my report show data of multiples dataset.
=Sum(iif(Fields!Id.Value = Parameters!Id.Value, Fields!Jan.Value,""),"Other_DataSet")
This code below works fine. But use default dataset, setted on bind propertie.
=Sum(iif(Fields!Id.Value = Parameters!Id.Value, Fields!Jan.Value,""))

This would be solved by using the Lookup function.
=SUM(IIF(Fields!Id.Value = Parameters!Jan.Value, LOOKUP(Fields!Id.Value, Fields!MatchingKeyIn2ndDataset.Value, Fields!ValueToReturn.Value, "Other_Dataset"), 0)

Related

Create dataframe specific lists in a function

I have several datasets. I would like to create a list for each one. Is there a way to do this in some kind of function? As of now I write it one below the other, since the code is quite long I don't want to do it manually for each dataset. I want to create a datasource list for each dataset, which contains the information of the respective dataset. As of now, my code looks like this:
datasource = df['Data_source'].tolist()
datasource1 = df1['Data_source'].tolist()
datasource2 = df2['Data_source'].tolist()
datasource3 = df3['Data_source'].tolist()
...
Thank you!

Populate the data in its own field

How can the data be populated in its own field? See the field called 'vSoup Text'.
SELECT [iFormID]
,[iPracID]
,[iPatID]
,[vFormName]
,[vSoapText]
,[tHTML]
,[iUserID]
,[dDATE] FROM CustomForm where iPatID = 40 and vFormName = 'Diabetes Screening'
I need to break the data when you see '/br'
The only way that I've found to do this is by using a function. You could use SSIS, but the way that I've used is using a function.
https://sqlperformance.com/2012/07/t-sql-queries/split-strings

How to edit a query in Apache Superset?

I'd like to change the query so that the metrics / labels are different. So instead of the chart saying "sum_sum_girls", it would say something like "Total Girls" instead.
Current query is as follows:
SELECT state AS state,
SUM(sum_girls) AS sum__sum_girls
FROM birth_names
WHERE ds >= '1918-05-11 00:00:00.000000'
AND ds <= '2018-05-11 18:03:20.000000'
AND state NOT IN ('other')
GROUP BY state
ORDER BY sum__sum_girls DESC
LIMIT 50000
OFFSET 0;`enter code here`
I'd like to change it so it says
SELECT state AS state,
SUM(sum_girls) AS Total_Girls
FROM birth_names
WHERE ds >= '1918-05-11 00:00:00.000000'
AND ds <= '2018-05-11 18:03:20.000000'
AND state NOT IN ('other')
GROUP BY state
ORDER BY sum__sum_girls DESC
LIMIT 50000
OFFSET 0;
Any advice? Tried Googling to no avail. I'm used to being able to create easy custom SQL queries in Tableau.
You should be able to create custom queries by navigating to 'SQL Lab' > 'SQL Editor'.
You should then be able to create queries and re-use them in your graph.
See "Creating Datasources Using SQL Lab" on https://duperset.com/getting_started
Not sure if this is what you are looking for, but I'm gonna try.
For a chart you can define a Verbose Name for any metric you have. This is going to be the name displayed as a legend to the chart.
To do so, please go to the Datasuource(sometimes it is also called Table) you use for the chart and there to the List Metrics tab.
Go to Edit Datasource and in tab Metrics define metrics and its labels which will be shown in the chart.
Another approach is to define it directly in chart like in the picture below:

Retrieving Values from Model Object

Im using following code to train my model
trip_model = sm.OLS(x_dependent, y_variables).fit()
and print summary as
trip_model.summary()
I just want to take only the following values out of Summary
F-statistic , coef
how to get it?
The value returned by the fit function is a RegressionResults structure. You can check the documentation to see how to access each particular value:
f_statistic = trip_model.fvalue
coef = trip_model.params

SRSS Report Builder SUM IIF from different datasets

I have two datasets in Report Builder 3.0 with a similar field and I want to put a SUM of the number occurrences of a particular value in that common field across both datasets.
I've got an expression I'm using for each individual dataset:
=SUM(IIF(Fields!caseorigin.Value = "mail",1,0))
and
=SUM(IIF(Fields!cliorigin.Value = "mail",1,0))
But I can't seem to work out a way to sum the values from both datasets. I've tried:
=SUM(IIF((Fields!caseorigin.Value, "caseDS") = "mail",1,0)) + SUM(IIF((Fields!cliorigin.Value, "cliDS") = "mail",1,0))
Is there any way to make this work, or an alternative method?
Just looks like a syntax error here; when specifying a scope it should like something like:
=Sum(Expression, Scope)
Applying this to your example:
=SUM(IIF(Fields!caseorigin.Value = "mail",1,0), "caseDS")
+ SUM(IIF(Fields!cliorigin.Value = "mail",1,0), "cliDS")
Should work for you.