Want to filter on the basis of a global variable
sadozaiw
Member Posts: 19
Dear All!
I have made a report "Stock Evaluation" on Item table. In our database, the Unit Price is comming from another table called "Sales Price".
So i made a variable in the report and am taking unit price in it from Sales price table.
The problem is how can i allow users to filter according to unit price like unit price > 2000 or < 3000 etc.
Please help
Thanks.
I have made a report "Stock Evaluation" on Item table. In our database, the Unit Price is comming from another table called "Sales Price".
So i made a variable in the report and am taking unit price in it from Sales price table.
The problem is how can i allow users to filter according to unit price like unit price > 2000 or < 3000 etc.
Please help
Thanks.
Do to others as you wish others to do to you.
0
Comments
-
I'm not sure if I understand exactly, but it seems you're just asking for how to filter? Just search the help on "Entering Criteria in Filters", and there's what you need.
In your case, you can filter like '>2000&<3000' to get every price between 2000 and 3000. '2000..3000' should work as well.
Is this what you want?0 -
I'm not sure too if I understand, but if you want to allow user filter on unit price, take new field on Request form, where the user can set the filter (for ex. >2000&<3000) and then use the filter
UnitPrice.SETFILTER("unit price",'%1',ReqFormValueFilter);0 -
Let me clarify what is the problem. I have made a report based on dataitem "ITEM" table. Now unit price is in another table called Sales Price.
so i made a globalariable in the report and called "UnitPrice" and then write code in my report to populate this variable. Until here, i have no problem.
The problem is that now user wants to filter the report on the basis of Unit Price, which is a variable, so how can they filter on the basis of a variable?
The other problem is that the datatype of Unit Price in sales price table is decimal and if i make a new text box in request form, and keep it's datatype to decimal, it will not take any operator as > or <less than
please help.Do to others as you wish others to do to you.0 -
Use two box on reqest form with two wariable (unitpricefrom, unitpriceto - decimal) and then filter records in OnPreDataItem
SETRANGE("Unit price",unitpricefrom,unitpriceto);
or use one text box with variable of type CODE (fe. MyFilter) and then filter
SETFILTER("Unit price",MyFilter);0 -
Hi Framus!
Thanks for your reply, i tried it but it is giving me compilation error
Type conversion not allowed
Decimal := Code
The column in the sales price table is of datatype decimal, and MyFilter is of type Code,
I tried to make the MyFilter decimal aswell but it will not take any operator.
Pls help.....Do to others as you wish others to do to you.0 -
Yes, you must filter
SETFILTER("Unit Price",MyFilter); (not "Unit Price",'%1',Myfilter)
I repaired it.0 -
Thanks a lot Farmus! this did the trick.
Do to others as you wish others to do to you.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
