Spaces:
Sleeping
Sleeping
Commit ·
bfc9113
1
Parent(s): 716d32b
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,23 +62,24 @@ if index is None:
|
|
| 62 |
text = st.text_input("Query text:", value="Insert PQL here to generate Definitions or ask a PQL related question")
|
| 63 |
|
| 64 |
sub_prompt_instruction = """
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
2.) DEFINITION: Calculate the proportion of gained cash discounts based on the total possible volume of cash discounts in the preceding year.
|
| 73 |
|
| 74 |
-
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
-
3.
|
| 78 |
-
|
| 79 |
-
QUERY: KPI(\"FORMULA_AccDocItem_SUM_GainedCashDiscountThisMonth\") / KPI(\"FORMULA_AccDocItem_SUM_PossibleCashDiscountThisMonth\")
|
| 80 |
-
|
| 81 |
-
..."
|
| 82 |
|
| 83 |
"""
|
| 84 |
|
|
|
|
| 62 |
text = st.text_input("Query text:", value="Insert PQL here to generate Definitions or ask a PQL related question")
|
| 63 |
|
| 64 |
sub_prompt_instruction = """
|
| 65 |
+
For the provided list of PQL queries, write the definition for each one and maintain the order in which the Queries are listed. For example, if given this string:
|
| 66 |
|
| 67 |
+
[QUERY: COUNT_TABLE(\"_CEL_AP_ACTIVITIES\"),
|
| 68 |
+
QUERY: SUM( CASE\n WHEN KPI(\"FORMULA_Activity_CLASSIFICATION_UserType\") = 'MANUAL'\n THEN 1 ELSE NULL\nEND )*1.0,
|
| 69 |
+
QUERY: SUM( \n CASE\n WHEN \"_CEL_AP_ACTIVITIES\".\"ACTIVITY_EN\" NOT IN ( 'Due Date passed', 'Cash Discount Due Date passed', 'Vendor Creates Invoice', 'Record Goods Receipt')\n THEN 1 ELSE 0\n END \n)]
|
| 70 |
|
| 71 |
+
return an html formatted answer with definition and corresponding query each on its own line and numerated as a list like this:
|
| 72 |
|
| 73 |
+
1. DEFINITION: Get a full count of the activities table.
|
| 74 |
+
QUERY: COUNT_TABLE(\"_CEL_AP_ACTIVITIES\"),
|
| 75 |
|
|
|
|
| 76 |
|
| 77 |
+
2. DEFINITION: Get a count of the number of activities with manual users.
|
| 78 |
+
QUERY: SUM( CASE\n WHEN KPI(\"FORMULA_Activity_CLASSIFICATION_UserType\") = 'MANUAL'\n THEN 1 ELSE NULL\nEND )*1.0,
|
| 79 |
|
| 80 |
|
| 81 |
+
3. DEFINITION: Get a count of the number of activities that are not titled 'Due Date passed', 'Cash Discount Due Date passed', 'Vendor Creates Invoice', or 'Record Goods Receipt'""
|
| 82 |
+
QUERY: SUM( \n CASE\n WHEN \"_CEL_AP_ACTIVITIES\".\"ACTIVITY_EN\" NOT IN ( 'Due Date passed', 'Cash Discount Due Date passed', 'Vendor Creates Invoice', 'Record Goods Receipt')\n THEN 1 ELSE 0\n END \n)
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
"""
|
| 85 |
|