Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I need help with replacing a field name with a variable name in an expression.
Basically, I have the below for example:
sum({<COMPLETED={'COMPLETED'}>}TICKETS)/sum({1}total <CALENDAR_MONTH> TICKET_VOLUME)
How should I rewrite the expression in order to replace 'CALENDAR_MONTH' with a variable called vMonths?
I tried <vMonths> and <=$(vMonths)> but it doesn't seem to work properly.
Thanks in advance!
@ShellyG make sure that your expression in variable should have "=" which basically should evaluate first So add "=" if you don't have like below
=pick(match([~VIEWBY6_NAME], 'Fiscal', 'Calendar')
,'FISCAL_MONTH'
,'CALENDAR_MONTH')
Now you can try below expression
sum({<COMPLETED={'COMPLETED'}>}TICKETS)/sum({1}total <$(vMonth)> TICKET_VOLUME)
If it still doesn't work then try below expression without using variable
sum({<COMPLETED={'COMPLETED'}>}TICKETS)/
pick(match([~VIEWBY6_NAME], 'Fiscal', 'Calendar'),
sum({1}total <FISCAL_MONTH> TICKET_VOLUME),
sum({1}total <CALENDAR_MONTH> TICKET_VOLUME))
Hi,
try below:
'$(vMonths)' use this in place of field name.
Thanks
share variable definition..
Hi Prashant,
This is the definition:
pick(match([~VIEWBY6_NAME], 'Fiscal', 'Calendar')
,FISCAL_MONTH
,CALENDAR_MONTH)
VIEWBY6_NAME is referring to an inline table that I made. Afterwards in the app I have created a button where you can select between fiscal and calendar with always one of the two selected.
I tried this but it didn't work with my expression...
Try like this :
pick(match([~VIEWBY6_NAME], 'Fiscal', 'Calendar')
,'FISCAL_MONTH'
,'CALENDAR_MONTH')
Still nothing 😞
@ShellyG make sure that your expression in variable should have "=" which basically should evaluate first So add "=" if you don't have like below
=pick(match([~VIEWBY6_NAME], 'Fiscal', 'Calendar')
,'FISCAL_MONTH'
,'CALENDAR_MONTH')
Now you can try below expression
sum({<COMPLETED={'COMPLETED'}>}TICKETS)/sum({1}total <$(vMonth)> TICKET_VOLUME)
If it still doesn't work then try below expression without using variable
sum({<COMPLETED={'COMPLETED'}>}TICKETS)/
pick(match([~VIEWBY6_NAME], 'Fiscal', 'Calendar'),
sum({1}total <FISCAL_MONTH> TICKET_VOLUME),
sum({1}total <CALENDAR_MONTH> TICKET_VOLUME))
Hi Kush,
Thank you for your idea, it works 🙂
Best Regards,
Shelly