Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, everyone!
I have example with simple data set:
ID | Name | Sales | Flag | Result |
1 | Name1 | 23 | 1 | |
1 | Name1 | 11 | 1 | |
1 | Name1 | 0 | 1 | |
2 | Name2 | -28 | 1 | |
2 | Name2 | 22 | 1 | |
3 | Name3 | 54 | 0 | |
3 | Name3 | -2 | 0 | |
4 | Name4 | 3 | 1 | |
4 | Name4 | 3 | 1 | |
5 | Name5 | 100 | 1 | |
5 | Name5 | 8 | 1 |
Using Dynamic update i need to set Done value into Result field for those IDs, which in TOTAL have Sum({<Flag={1}>}Sales)>=30.
So the expected result should be (applied only for records with 1 and 5 id):
ID | Name | Sales | Flag | Result |
1 | Name1 | 23 | 1 | Done |
1 | Name1 | 11 | 1 | Done |
1 | Name1 | 0 | 1 | Done |
2 | Name2 | -28 | 1 | |
2 | Name2 | 22 | 1 | |
3 | Name3 | 54 | 0 | |
3 | Name3 | -2 | 0 | |
4 | Name4 | 3 | 1 | |
4 | Name4 | 3 | 1 | |
5 | Name5 | 100 | 1 | Done |
5 | Name5 | 8 | 1 | Done |
I tried to use if statement to define necessary records, but sum function in Dynamic update isn't working.
Will be grateful for any help.
Thanks.
or this
IF(SUM({<Flag = {1}>}Total <ID> Sales) >=30,'Done')
Thanks, but if you suggested you use something like this:
=if(SUM({<Flag = {1}>}Total <ID> Sales) >=30, 'UPDATE Main SET "Result" = ' & chr(39) & 'Done' & chr(39) & ';')
Unfortunately it's not working
'UPDATE Main SET "Result" = ' & chr(39) & 'Done' & chr(39)& ';')
What is this? and why you are using this?
I never suggested that..
I'm using this, because i need update Main table via Dynamic Update statement, which is linked to the button.
So the idea is to define somehow Dynamic Update statement (Update Table.... SET... WHERE...), which will update only necessary records. Comparing with total sum per each ID should be done inside Dynamic Update statement (not by creating some additional flag in the script).
Where are you trying to use this?
At front end?
At back end?
Can you provide qvw or qvf with sample data along with your work out so that we can understand what exactly you are doing? Because from your above explanation, I don't understand what exactly you are trying to do.
It would be good if you ask question with proper description in the initial post, which will make our job easy to understand and answer...
'Dynamic update' action is always done in front-end.
In my post i already attached xls and qvw (qvw is already with button, which should update table)
Thanks.
Try something like this
or this
Thanks a lot!