Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to achieve an outcome whereby the text colour within a text box changes based on the data value of the current period compared to the previous period. The below continues to result in red text irrespective.
I have tested the maxdate and maxdatepreviousperiod variables and they are working as expected
if (sum({<[Category 2]={'Excess'},[Pay Period]={"$(= '$(vmaxdate)')"}>}Count)>
sum({<[Category 2]={'Excess'},[Pay Period]={"$(= '$(vmaxdatepreviousperiod)')"}>}Count), rgb(255,0,0), rgb(0,128,0))
Have you checked if these work to give the right number you expect in a text box?
sum({<[Category 2]={'Excess'},[Pay Period]={"$(= '$(vmaxdate)')"}>}Count)
sum({<[Category 2]={'Excess'},[Pay Period]={"$(= '$(vmaxdatepreviousperiod)')"}>}Count)
What's the result of your if condition?
you should verify the format of all dates
Thanks Sunny. The first returns the correct number but the second returns 0.
How do you define vmaxdate and vmaxdatepreviousperiod? Also, are you making selection in any date and time related field other than Pay Period?
vmaxdate =date(Max([Pay Period]),'D/MM/YYYY')
vmaxpreviousperiod =date((vmaxdate-14),'D/MM/YYY')
There are no other selections referring to date / time etc.
How about if you do this
vmaxpreviousperiod
=Date(Max([Pay Period])-14,'D/MM/YYY')
Unfortunately still the same outcome. The variable works when returning the date but when I include it in an expression to provide the number it returns 0.
I don't know if this is a typo, I see a Y missing from the format part... try this
=Date(Max([Pay Period])-14,'D/MM/YYYY')