Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have variables defined in my load editors and they are something like this:
SET v1 = Sum({$<[VIType]={'Account'}, [FQuarter]={"<=$(=right(GetFieldSelections(FQuarter),1))"}, [fYear]-=>} [Customer Targets]) ;
If i use them in a table like
=Sum({$<[VIType]={'Account'}, [FQuarter]={"<=$(=right(GetFieldSelections(FQuarter),1))"}, [fYear]-=>} [Customer Targets])
it works fine. However, when i use this variable in a table like $(v1), it doesnt work. The statement in "" doesnt resolve.
It shows [FQuarter]={"<="}.
Any ideas how to fix this?
Thanks
Hi @waleeed_mahmood ,
I think the issue is with using Right(). You are passing something like :
FQuarter={"<=2"}, when selection is FQuarter is Q-2. but your field FQuarter is a string, such range selections wont work on string field. Instead you need to create another Field FQuarterNum in your calendar which will have numerical values 1,2,3,4 for Quarter. & use that in your set variable.
FQuarterNum={"<=$(=right(GetFieldSelections(FQuarter),1))"}
Try something like this, & Let me know if it worked.
*Edit*
Hi, I later realized that getfieldselections won't pass a single selections until Select only one value is enabled for that specific field. Check on that part as well.
Regards,
Rohan.
Hi @waleeed_mahmood ,
Have you tried using '=' before the Variable in the measure expression ? Also this expression wont evaluate until you make selections in the Quarter field on the dashbaord.
Regards,
Rohan.
Try with:
LET v1 = 'Sum({'&chr(36)&'<[VIType]={''Account''}, [FQuarter]={"<='&chr(36)&'(=right(GetFieldSelections(FQuarter),1))"}, [fYear]-=>} [Customer Targets])' ;
Hi, Its not a variable but a field in my master calendar. and yes the quarter selection is fixed.
Hi @waleeed_mahmood ,
I think the issue is with using Right(). You are passing something like :
FQuarter={"<=2"}, when selection is FQuarter is Q-2. but your field FQuarter is a string, such range selections wont work on string field. Instead you need to create another Field FQuarterNum in your calendar which will have numerical values 1,2,3,4 for Quarter. & use that in your set variable.
FQuarterNum={"<=$(=right(GetFieldSelections(FQuarter),1))"}
Try something like this, & Let me know if it worked.
*Edit*
Hi, I later realized that getfieldselections won't pass a single selections until Select only one value is enabled for that specific field. Check on that part as well.
Regards,
Rohan.
Hi Rohan,
This made alot of sense why it wasnt working. thanks.