Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have created an variable in script but it is showing an script error,but i have tested the same in text object its working fing fine.
Please find the below error.
Variable : let vCurr_Month_Year = month(monthstart(max(ActivityDate-1)))&' '&(year(max(ActivityDate-1)));
Thanks..
But it is giving the text only.
This came back to SET instead of LET, but nareshthavidishetty mentioned SET won't work here.
Not sure why it won't work
Your original post shows a text box with 'Oct 2016' and you original expression is a concatenation of strings wich will return also a text, what you want if it's not a text?
Hi,
I have used the set but it gives the text only.
SET vCurr_Month_Year = "Text(Date(Max(ActivityDate), 'MMM YYYY'))";
Result : "Text(Date(Max(ActivityDate), 'MMM YYYY'))"
Thanks..
Ok, now I understand, add an starting equal sign:
SET vCurr_Month_Year = "=Text(Date(Max(ActivityDate), 'MMM YYYY'))";
May be you need to add an equal sign?
SET vCurr_Month_Year = "=Text(Date(Max(ActivityDate), 'MMM YYYY'))";
Hi,
Please find the below
let vCurr_Month_Year = month(monthstart(($(vMaxCal))-1))&' '&(year($(vMaxCal))) ;
let vLast_Month_Year = month(monthstart(($(vMaxCal))-1))&' '&(year($(vMaxCal))-1);
let vmonth =MonthName($(vMaxCal));
Let CurrentYear=year(today()-1);
Let LastYear=year(addyears(today()-1,-1));
Let CurrentMonth=month(today()-1);
Let LastMonth=month(addyears(today()-1,-1));
LOAD * INLINE [
KPI, SortOrder
$(vCurr_Month_Year), 1
$(vLast_Month_Year), 2
DELTA by MARKET, 3
DELTA by SSS, 4
];
LOAD * INLINE [
KPI, KPI2, SORTORDER2
$(vCurr_Month_Year), TRAFFIC, 1
$(vCurr_Month_Year), CUSTPAYS, 2
$(vCurr_Month_Year), INVCOUNT, 3
$(vCurr_Month_Year), ADJ TRAFFIC, 4
$(vCurr_Month_Year), CLOSERATE, 5
$(vCurr_Month_Year), WRITTENAMT, 6
$(vCurr_Month_Year), AVGINVOICE, 7
];
Front end:
Expression logic:
if(KPI= '$(vCurr_Month_Year)' and KPI2='TRAFFIC', num(Sum({<Year={'$(vCurrentYear)'}>}TRAFFIC),'#,##0'),
if(KPI= vCurr_Month_Year and KPI2= 'CUSTPAYS', Sum({<Year={'$(vCurrentYear)'} >}CUSTPAYS),
if(KPI= vCurr_Month_Year and KPI2='INVCOUNT', Sum({<Year={'$(vCurrentYear)'} >}INVCOUNT),
if(KPI= vCurr_Month_Year and KPI2='ADJ TRAFFIC' , num(Sum({<Year={'$(vCurrentYear)'} >}ESTCUST),'#,##0'),
if(KPI='DELTA by MARKET'and KPI2='ADJ TRAFFIC', num(((Sum({<Year={'$(vCurrentYear)'} >}ESTCUST)-Sum({<Year={'$(vLastYear)'} >}ESTCUST))/Sum({<Year={'$(vLastYear)'} >}ESTCUST)),'#.#%')
In the above chart label i need to month and year label as dynamic.
Thanks..
Hi,
The above is the script and expression logic.Please let me know what to done to get dynamic month lable.
Thanks..
Could you post your qvw sample ?
Try from Label Like below
Current Month
------------------------
='Month' & Max(Month)
Previous Month
-----------------------
='Month' & Max(Month)-1