Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator III
Creator III

using Expression in script to get counts.

Hi,

i have below Equation:

count({$<MonthPeriod_Runrate={'$(=month(weekend(Max(CanonicalDate)))& year(weekend(Max(CanonicalDate))))'}>}Distinct Date_Runrate)

this gives me 28 count. in front end

So instead of using this equation everywhere i have made it global variable in script, and getting count of that by

$(vMonthPeriod_Runrate_Count) = 0

but above  gives me zero count

My variable in script is

Let vMonthPeriod_Runrate_Count = 'count({$<MonthPeriod_Runrate={"<$' &'(=month(weekend(Max(CanonicalDate)))& year(weekend(Max(CanonicalDate))))"}>}Distinct Date_Runrate)';

I am not getting any error while loading also, What is the wrong i am doing here.?

Regards,

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Does the expression contain a leading = sign? If not, you should be using =$($(vMonthPeriod_Runrate_Count)) - the inner $ sign expands the variable into the expression, the outer one then evaluates the expression.

How are you using the expression - in a text box, chart expression, etc?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
berryandcherry6
Creator III
Creator III
Author

Hi,

Thanks for reply

i am using in expression for simple table

My expression looks like below

if(ClientMetrics='Parlege',((floor($(vCredit_Course_Completed)/$(vMonth_Period_Count)*

  $(vMonthPeriod_Runrate_Count))*20)+((floor($(vCredit_Usersigned)/$(vMonth_Period_Count)*

  $(vMonthPeriod_Runrate_Count)) - floor($(vCredit_Course_Completed)/

  $(vMonth_Period_Count)*

  $(vMonthPeriod_Runrate_Count)))*10)))

for checking i tried     =$($(vMonthPeriod_Runrate_Count))   this gives nothing in textbox

Anil_Babu_Samineni

Can you please provide Full expression, Because for above one some variables are there. Can you please provide Variable expressions or full expression ...

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
berryandcherry6
Creator III
Creator III
Author

Hi,

In Script, i have below variables

Let vCredit_Course_Completed = 'sum({$<MonthPeriod1 = {"<$' &'(=Date(MonthStart(weekend(Max(CanonicalDate))),''MMM-YY''))"}, DateType= {''completion''},

  client_id = {'1'},final_test_status={''passed''}>} course_completed)';

   

Let vCredit_Usersigned =  'sum({$<MonthPeriod1 = {"<$' &'(=Date(MonthStart(weekend(Max(CanonicalDate))),''MMM-YY''))"}, DateType= {''signed''},

  client_id = {'1'}>} user_signed)';

   

Let vMonth_Period_Count = 'count({$<MonthPeriod1={"<$' &'(=max(MonthPeriod1))"}>}Distinct CanonicalDate)';

Let vMonthPeriod_Runrate_Count = 'count({$<MonthPeriod_Runrate={"<$' &'(=month(weekend(Max(CanonicalDate)))& year(weekend(Max(CanonicalDate))))"}>}Distinct Date_Runrate)';

i am getting values for first three equation variables, but not for last variable  vMonthPeriod_Runrate_Count .

Is it because of year and month keyword in script i am not getting count.????

jonathandienst
Partner - Champion III
Partner - Champion III

I suggest you upload a small sample qvw file containing some representative data, the chart and the variables.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
berryandcherry6
Creator III
Creator III
Author

Hi,

Please check attached qvf file