Help needed with Real-time data input and String search
Hello Pyramid Community,
I wanted help with 2 items:
1) I am working on building a pyramid dashboard which simulates pricing decision. For this simulation, I need to get real time input from the user for order quantity. Could someone suggest the best way to obtain the real time input on the dashboard? which can then tweak the results generated by the underlying data model
2) I am trying to determine if the customer is new or existing based on the real time input of the customer name. My logic is to compare the Text parameter input for name with the existing customer names in the model. But I'm facing challenges in implementing the same. Could you suggest the best way to do this?
E.g: I enter "Angela" as customer name - if this name is there in the existing list of customers, my dashboard should display "Existing Customer", otherwise "New Customer"
Will be very grateful if someone could help me with the above 2 challenges.
10 replies
-
Hi
For the numeric input, simply use a numeric global parameter and then use that parameter in your formulate calculations.
For the customer name, create a parameter containing all the customer names. Use that parameter on your dashboard slide and use it in your queries. The visual parameter object has search capabilities to select the customer, you don't need a free text input to enter the name and then compare it to the customer members.
You can set the search type in the settings
Hope that helps.
Ian
-
Hi ,
Thank you so much for the prompt reply and help. The solution to the first item is very helpful.
I am looking for a different kind of functionality with respect to the second item. Let me explain in more detail:
I want to be able to input a customer's name, check if the customer is new or old (by comparing them against the existing list of customers) and take some action based on this logical expression. If the customer is existing, I follow course A: give X% discount on list price; if the customer is new, course B: give Y% discount on list price.
I hope I have explained my problem statement better. Can this be done on Formulate using 'if' or any other functions? I faced challenges in using string functions.Kindly let me know if you have a suggestion for implementing this. Again, Thanks a lot for your help.
Regards -
OK, this is a bit more complicated.
Everything in Pyramid is driven by queries, there is no direct link between entering a text string and testing it against data, we have to go via queries. Here's how I solved your problem.
1. Create a global text parameter with free input - Customer Name
2. Create a global numeric parameter with free input - Factor
3. Create a dynamic list of customer names filtered by the text parameter. You can choose how the text string is compared. This will result in a list of customers what match the condition, or an empty list if there are no matches. Note where the list is located, in the customer name hierarchy.3. Create a measure "Exists" that counts the number of items in the list and returns "True" if there are more than zero entries, or "New" if it is an empty list
4. Create a new Measure (This will be your applied discount) by multiplying the base Measure (Sales in my case) by the global numeric parameter, Factor, if Exists value is "True", or a scaled Factor if it is "New".
5. Create your query for the base and factored base values
6. Add the Parameters and Query to your dashboard and make sure the parameters interact with the grid (or chart or whatever) and are connected to the parameters driving the grid.
7. Create a simple query that just shows the value of the Measure, Exists. This can then be used to read off the customer status using dynamic text to display to the user if the customer exists or is new. Make sure the customer name parameter interacts with the dynamic text.
8. At run time you can see that if we enter text that doesn't match any customer, then the discount factor is changed and the dynamic text says New.
Hope that Helps
Ian -
Hi
The first part is simple, just create a grid with customer name on the rows and choose to display the filtered customer name list. Then add whatever other attributes and measures you want.
I don't understand the second part, as if the entered name is not a customer, what details would you hold?
Ian
-
Hi
I'm still confused.
So your user has entered a customer name that does not exist in the data. Obviously the grid will show "Not enough information" as there are no customers in the filtered list. So it doesn't matter what measure you choose, nothing will appear.
Are you in some way wanting to add the name entered into the database?
Pyramid does not support write back into a database in this way.
The only way, potentially to do that would be to write some kind of data entry form in JavaScript on a web page that performed this action and have that web page displayed conditionally based on if the customer is new or not. This can be done using mini-tabs. But again, the data entry would need to be a web page built outside Pyramid.
Hope that helps,
Ian