Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Louveduval
Creator
Creator

Button to make variable

Hello I'm sorry to bother you again 

I try to make a button to change a varible  and have a mesure with a calendar date or an exercise date 

So I made 

Louveduval_0-1695631608171.png



and I my mesure sum(
{<
[Filtre CA vente] = {"Oui"},
[Type date]={'BL vente','Facture vente'},
Date={">=$(=AddYears(Max(vDatedébutex),-1))<=$(=Date(AddYears(RangeMin(Today(),vDatefinex),-1)))"},
AnnéeMois=
>}
[Montant HT vente])

But When I push in the button the variable doesn't change 

Louveduval_1-1695631787144.png
Can you help me ?  

Best regard 

 

Labels (4)
1 Reply
sbaro_bd
Creator II
Creator II

Hello,

If you want to make this change, you need to have two buttons and three variables : 

  1.  Three variables : the two first variables are the ones you want to switch according to your need. The third one will allow you to do this action
    //The action variable
    vSwitch = 1
  2. Two buttons : add two buttons, choose the action "Définir la valeur de la variable". For the first one, choose 1 for value, and 2 for the second. 
    sbaro_bd_0-1695737635559.png
    You can add a condition for background coloration
    IF(vSwitch=1,Green(), Blue()) // and 2 for the second button​
  3. In your measure expression : now, you can create a variable whose the value change according to the activated button

That's the global idea of the process. Let us know if it was helpful.

Regards.