This might be/seem like a basic question. Company just moved us to BO and trying to figure out a formula that would be easy in any other language. Can't seem to get the syntax and can't find documentation online.
=If([Disposition]=2 **Or 5**;Count([Sessionid]))
Apparently the "Or 5" part of this formula is wrong, cannot figure out how to implement it.
You need to list each condition separately. If you update it like below you should have it corrected.
=If([Disposition]=2 Or [Disposition]=5;Count([Sessionid]))
Related
Im new to uipath and coding in general. I know most of the basics from what was taught but they didnt go through how to form "condition" statements in the "if" activity. or basically any form of conditions. Where can i go about to learning them? is it a specific language?
kinda like: not Months.Contains(ExpenseMonth)
i wouldnt be able to come up with that because i dont know what is acceptable/readable to uipath studio
also regarding those calculations. where can i find more information on those? to learn more about
kinda like: (int32.Parse(row("Value").ToString) * 100 / monthlyTotal).ToString
they didnt really give me details on how to form that
so essentially, if i wasnt spoon fed with those statements, i would be stuck
It depends on which activity you are using. Usually it's VB.net. Find more about that programming language here.
And yes you will need to get the basics of that language on your own. UiPath isn't really helping you find the correct condition. It is more a tool that can use VB.net.
And soon you can switch to C# completely. But that is not yet ready and still experimental. Also, I would recommend you to stay with VB.net as it is way easier to learn as a first language. Currently, you can only use C# and Invoke Code activity.
To your first example from above:
not Months.Contains(ExpenseMonth)
That depends on your variable type. That looks like a DateTime or a String type and so you are able to use predefined functions that come with it. You can show them but simply clicking CTRL + SPACE after the dot.
And your second one:
(int32.Parse(row("Value").ToString) * 100 / monthlyTotal).ToString
I would always recommend you to use CInt instead of int32.parse. Look here. And it is often not needed to convert the row value into a String. As it is usually already in that type by default.
But again. You will need to learn the basics of VB.net before you are able to write a good business logic in UiPath that makes sense and is best practice.
I'd like to know what suggestions there are for Googling (or using other search engines if preferable) for Ruby syntax. I'm very new, and a substantial part of my baptism by fire comes by way of reading other people's code. Ruby in particular can be challenging this way-- it's fantastically compact and easy to read if you know how to read it, so to speak. But figuring that out can be difficult at times. It's worth it, but difficult. So, for example, let's say I encounter an expression like this:
tquery = "#{MASTER_URL}#{query_str}"
Well, apparently there's something going on with the syntax #{stuff}, but what? A variable being manipulated, it seems? If you encountered such an expression and didn't know about interpolation/substitution and have no ready access to someone to ask directly, how would you go about Googling that? That's just an example, of course, but I hope it illustrates the type of problem I'd like to address.
Also, if there are better tags to apply to this post please let me know and I will add. Thank you.
Symbolhound is pretty good for this. For example, here's the search for Ruby's #{}.
Mind, as you can see from the results, it doesn't necessarily come immediately back and tell you what the notation you searched for is named, or how it's defined, but it does return some helpful results to get you started. It's especially useful for punctuation-based syntax elements that are difficult or impossible to search for in other search engines.
I need to develop a user interface for inputting something like "if x or (y and z) then do a, b, and c". The data to be entered itself is already quite complicated, how do you wrap it up in an intuitive UI?
Here's my answer from a similar question: Intuitive interface for Composing Boolean Logic?
I would break your interface into two parts: the condition and the result.
Here's an example of the conditional interface:
A Few Thoughts
The interface starts out simple
If it gets complicated, it's because the user built it step by step
No editing or drag/drop - just creating and deleting branches
Conditions are a simple dropdown in this example, but could be more complicated or possibly negated. Basically this interface lets you compose expressions.
I think it's a good idea to avoid this type of interface if possible
Here is an example of how I solved the problem for a bug database. This was done a decade ago on a linux box, so the L&F is rather motif-ish, but it shows the general concept:
(source: clearlight.com)
It works pretty much as you expect. You can change "ANY of the following" to be "ALL of the following" and the labels on the subsequent lines will change from "or" to "and". The "IS" button can be changed to "IS NOT" as well as "Matches pattern" and a few other choices.
You click on the +/- buttons to add additional criteria. You can create logical groups which allow you to do expressions like "a or (b and c)", yet it still almost reads like a collection of English sentences.
In your case, instead of an "Order by" section you might have a "do these things" section.
This would be cumbersome to use if you have to create very complex queries, but if you're needing a complex query you're probably smart enough not to need a GUI like this. This was designed more for the casual user for simple ad hoc queries.
I would definitely change the way this looks if I had it to do over again, but the basic mechanics work pretty well.
Will it always be binary logic like this (just Or's, And's, and Not's)? If so you could have the UI be a logic diagram designer, similar to the ones used in designing circuit logic.
This is a good article
http://www.lukew.com/ff/entry.asp?1007
I used the ideas in that article when building a form for entering Benefit Deduction rates. The short of it is, that he recommends building the form kinda like Mad Libs (remember those books as a kid).
There are many LINQ implementations such as LINQ-to-Flickr. To make something like this, do I make my own custom LINQ provider?
Thanks
Have a look at this tutorial
Aha. That's the only way.
Hit in google 'write LINQ provider'. There are many tutorials out there.
Start with understanding what exactly Expression is, how it differs from lambdas and how to work with them.
I find this book quite helpful too (at least - beginning).
Yes, to get started, the best place is looking at the IQToolkit on Codeplex. You'll learn a lot about how it works.
If you do find you need to build your own then look at IQToolKit and the The Wayward Weblog for a full series on how to do it.
I'm developping a mini search engine, and I want to implement the feature of searches based on logic operators AND OR...
I'm having a difficulty on parsing a query containing AND, OR, NOT... especially when it comes to parentheses... (cat or dog) not (bike not mike)
For simple AND, and OR queries, it's obviously too simple and I figured out how to formulate the sql query, but when it becomes that complicated I'm lost !!!
I'm not sure if search engines have this feature, but I want to dive into it for learning purpose.
I apologize for my last question which wasn't really clear, I hope this time I'm doing better.
I'd recommend looking at a lexer/parser generator like ANTLR. A simple grammar should be able to sort you out. There might even be an existing grammar for such a thing.
Take a look at the searchparser.py example from the pyparsing project.
It shows a way to implement:
AND,
OR,
NOT,
grouping and
wildcards.
All done in 293 lines of code (including comments and tests) ...
If you are using MySQL you can use the builtin boolean search:
http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html