Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
After making changes of Variables definition we are encountering with color code on Buttons based on these variables. Please find the details below.
vRef1 = Max (Date) for current month and vRef2 = Max (Date,2) for previous month
In the Variable Input, under DROPDOWN option we are using the DYNAMIC value as =concat(distinct [Date MMM YY],'|', -[Date MMM YY])
(Where Date MMM YY is the field created in script by using Date.)
Now the issue is that we are using 4 Buttons for Previous Month/Quarter/Half Year/Year and added variable =Date(Addmonths(Date#('$(vRefMth1)', 'MMM YY'),-1),'MMM YY') for each Button (depends on Month/Quarter/half Year/Year).
Here each button should change the color based on button selection.
Currently using the color code expression is
if(
(Year('$(vRefMth1)') * 12 + Month('$(vRefMth1)')) - (Year('$(vRefMth2)') * 12 + Month('$(vRefMth2)')) = 1,
RGB(229,155,157),
RGB(232,232,232)
)
By using this color code expression, the color is not applying as expected upon Button selection.
Please check and provide the corrected color code expression
Thanks,
S Kishore
Hi Everyone,
My issue resolved by using the below expression
Thanks
S Kishore
Hello, @surikishore7517
The issue is that your current code just checks if a one-month gap exists between two variables, rather than checking if the variable actually matches that specific button's "goal." To make the color change when kdealer plus clicked, the color expression needs to ask: "Is the current value of my variable equal to the date this button is supposed to represent?" Use the expression if('$(vRefMth1)' = Date(AddMonths(Date#('$(vRefMth2)', 'MMM YY'), -1), 'MMM YY'), RGB(229,155,157), RGB(232,232,232)) for the Month button, and simply swap the -1 for -3 (Quarter), -6 (Half Year), or -12 (Year) for the others. This ensures the button only lights up when the active selection matches that button's specific timeframe.
Hi @clairehar557ris ,
Thank you so much for the quick response.
Used your solution, still the color is not affected.
Thanks
S Kishore
Hi Everyone,
My issue resolved by using the below expression
Thanks
S Kishore