Azure logic apps Odata filter query with if statment on two columns - if-statement

Good morning,
I have a unique requirement where I have to apply a filter on "Get entities" from Azure table based on a condition, filters come from HTTP get request.
There are two filters - a and b.
If both filters passed to the flow are empty, no filter is applied.
If either one of the filters is not empty, the filter must be applied on that column.
If both filters are not empty, the filters must be applied on both columns.
Is it possible to apply an If statement in an ODATA filter query?
I can't seem to find a good answer.

For this requirement, we can just use "Condition" in logic app to implement it. It's not a smart solution, but it works.
First I use two variables to simulate your two filters from http request.
Then use another variable to store the result filter(s).
Now add a "Condition" to judge if filter1 is not equal to "empty".
If true, add another condition "Condition 2" to judge if filter2 is not equal to "empty" and set the value for filterResult.
If false, also add another condition "Condition 3" to judge if filter2 is not equal to "empty" and set the value for filterResult. Note: use expression string(' ') in "Set variable 4", or it will not allow us to save the logic app.
After that, we can use filterResult in "Get entities". The expression in below screenshot is trim(variables('filterResult')).

Related

Negative filtering by filter_box or some other mechanism

Let's say I have a column named Column1. There are more than 10k different values for this column, but my goal is to display on a dashboard all data except few of them. Is it possible to achieve it in Superset? As far as I understand the only one option to filter dashboard is a filter_box, and I have to choose values explicitly in filterbox, so no way to use a negative filter. Is it true, or there is some hidden mechanism?
You can use the limit selector values option to provide the filter out values you dont need by specifying the column name and the list of values you would like to ignore using the appropriate condition like *equals, not equals, etc

managing unique values across a complete list in SharePoint

I am trying to populate unique values across a multiple columns in a SharePoint list. For example if we have "column A" with value "X", none of the columns should accept the value "x" in the entire list.
Is it possible?
I tried the formula using an example.
=IF([columnA]=[ColumnB],TRUE,IF([ColumnB]<>"",TRUE,FALSE))
But i felt stupid as i had no idea why i feel it is right. But it doesn't work
Any simple and better ideas will be a great help!
I think you need PreSaveAction for this requirement, when item saving, the function will execute for client side validation, then you could call rest api to validate column A value and user input value, when return false, means validation failed and item will not save.
Demo thread.
https://sharepoint.stackexchange.com/questions/255633/limit-edit-in-sharepoint-list-to-only-3-items-per-user
SharePoint rest api filter.
https://www.c-sharpcorner.com/article/sharepoint-2013-using-rest-api-selecting-filtering-sortin/

How to put formula in Data Validation List Excel?

I am creating an excel sheet with following Data Validation drop down list.
NA
Done
(add some formula here)
Basically, i will be able to select either plain text "NA"/ "Done" from the dropdown list. But sometimes, I want the user to be able to calculate some values based on the cell respective to the row selected so, I want to have one formula as a choice inside the data validation dropdown list. Is this possible?
Data Validation List Source
When I click on Formulae option, it should execute the formula with respect to the cells in that Row
But currently, the formula that i put in doesn't execute, instead it will just show the whole formula in the cell when activated.
1)How can i make it so that when i select the formula from data validation list, it will execute it instead of filling up the cell with it?
2)How do i set the formula so that it will be using the cell from the current Row? (for example, if i am using the data validation List in N60, the formula should adapt itself to use the cell (let's say A60?).
I may not be able to help with the second part, but I was seeking an answer to the first and discovered a solution/workaround using Name Manager.
First, in Formula > Name Manager, create a new reference (the "refers to" will contain whatever formula you are wishing to ultimately display in the validation list. For this example, we use the formula reference "=IF($H54=..." and Name it "UniqueName"
Now, we go into Data Validation, Select List, and input the three items we want displayed in the list, with an equals sign preceding our newly named reference: ie. "NA,Done,=UniqueName"
Note: You can't start with the =UniqueName or validation will try to read it all as a formula and fail.
This method will allow the user to display "NA", "Done", or "=UniqueName" in the cell; if "=UniqueName" is selected, the cell itself will interpret this as a formula and execute it accordingly, displaying the results of "=IF($H54=...", or whateverelse you have designated to use as a named formula.
If it's too late for yours, I hope this helps someone else who may face a similar problem.
While I think I know what you're trying to say. Why don't you just use an IF formula to evaluate everything instead of selecting a drop down for every row manually. You already had it partially solved using IF. Just need to add the criteria for a "Done" and an "NA"
=if(A1="date","Done",if(A1<"date","NA",if(something else until you have all your catergories))
Just going to piggyback off of Mark's response.
If you really needed your named formula to be the first selection in the list, you can setup your list with a leading comma like so:
,=UniqueName,NA,Done
That worked out for my use, and there was no null item listed in the Data Validation drop down. Hope that helps!

Tableau: Creating Dynamic Filter to exclude names

I have been working on this for the better part of the day and would like to crowd source as I must just be missing something simple.
I would like to use a parameter control to create a dynamic filter that would exclude the names of individuals that have already participated in an event. For example in the following list of two fields:
Name-Event Name
Carl-Agriculture
Carl-Agriculture
Carl-Agriculture
Jodie-Business
Jodie-Agriculture
Jodie-Agriculture
Pam-Business
Pam-Business
Pam-Business
if the parameter was set to Agriculture, only Pam would show up on the list, and if it was set to Business only Carl would show up. This list will help stakeholders send invitations to potentially interested parties.
I have tried so many calculations including the parameter itself in IF statements, IIF statements, CASE statements, etc. I've also tried creating a second calculation to work off of the first but am still striking out.
Any ideas?
You got most of the way there on your own. To finish the job:
Place Name on the filter shelf
Select "Use all" on the General tab of the filter panel
Select "By field:" on the Condition tab of the filter panel
Choose the "If Exclusion Statement" field, Count aggregation function (NOT Sum in this case), and set the test to "= 0"
The effect of this filter is equivalent to the SQL group by Name having Count(If Exclusion Statement) = 0

Designing a generic Rest API

I need to design a rest api server in django. I am confused how to name the rest api
I have stored data in form of a matrix and 'rest api' allows various data transformations
eg
1. Apply mathematical function on a row
2. Apply mathematical function on a column
3. Remove row
4. Remove column
5. Add row
6. Add Column
7. Remove row if values are missing
---- so on
Can someone suggest me the right way of naming the rest apis. Should I go for one rest api for each one?. If yes, how will the url look like for GET/POST/DELETE/PUT ?
It will be helpful if you can point out an example
For,
Apply mathematical function on a row
Apply mathematical function on a column
These above should take the URL form of /api/v1/(?P<type>(row|column))/(?P<id>\d+)/math_function/(?P<math_function_name>\w+)$
These should also only respect 'PUT or PATCH' since, if we are following RESTful design, we are only looking to update a row or column with data from a mathematical function. The math_function is technically a sub collection of row or columns, hence why it's last in the URL structure.
For,
Remove row
Remove column
Add row
Add Column
These above should take the URL form of /api/v1/(?P<type>(row|column))/(?P<id>\d+)/$
These should also only respect 'POST or DELETE' as the only actions according to business logic says to remove or add.
For,
Remove row if values are missing
This should take the URL form of /api/v1/(?P<type>(row|column))/(?P<id>\d+)/conditional/(?P<condition_name>\w+)/$
The above endpoint should only respect 'DELETE' as we will only be removing rows here.
The above was written with the RESTful API design of /api/version/collection/id/subcollection/subid/