Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
KasperJeppesen1
Contributor III
Contributor III

A button to Progress in the selection of ID's

Hello,

I need to make button, that select the next ID in my list. 

I have attached a qvf file, where you can see 3 kpi's, my id list and the button. The point is, that it needs to take the next ID in the list and the KPI should change depending on the ID. 

So if no ID have been selected, it should take the first one. If first ID have been selected, it should take the second. 

I have some code on my file now, but I simply cannot get it to work. 

Hope you can help.

 

 

1 Solution

Accepted Solutions
gp_oconnor
Partner - Contributor III
Partner - Contributor III

Please see attached [changes to the actions].

View solution in original post

5 Replies
gp_oconnor
Partner - Contributor III
Partner - Contributor III

Please see attached [changes to the actions].

KasperJeppesen1
Contributor III
Contributor III
Author

@gp_oconnor 

Thank you! It worked.

I have a question. I tried to recreate your work, but got an error in: Next ID Value in my expression. When I have to type in:

=$(index)

it seems to only find a index function, not a variable. What could I have done wrong ? 

Thank you again for your help! 

 

gp_oconnor
Partner - Contributor III
Partner - Contributor III

@KasperJeppesen1 I think the syntax checker finds reserved words [functions etc.] before variable names.  In order to avoid that contention, it is worthwhile having a naming convention for variables where they start with a prefix like "v" or "v_".  The variable in this case could be called vIndex or v_index.

KasperJeppesen1
Contributor III
Contributor III
Author

@gp_oconnor 

Ah okay! 

Thank you for your help! 🙂 

KasperJeppesen1
Contributor III
Contributor III
Author

@gp_oconnor 

I hope you can help me a bit more. I uploaded a new example called "Question 2". The difference is that now the ID's is not ordered. They are different, where some are repeated. 

I have been playing around with the logic, and understand when you did the "+1", it just added +1 to find the next value. How can I move on in the selection, when the ID's does now have the order "1,2,3,4...."? 

I really appreciate your help.

Thank you!