Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - using sense I wish to use a KPI to show a calculation which counts records created before the current MonthName (where the field name is SUBS_CONNECTED_MONTH)
My expression works fine when selecting dates equal to todays Month Name:
Count({<SUB_CONNECTED_MONTH={"$(vCurrentMonth)"}>}Distinct SUBS_NUMBER)
Where I have a variable of :
vCurrentMonth:
=MonthName(Today(1))
I have tried to use a not equal value of <> instead of = but still cant seem to get it to work?
Any ideas or suggestions?
thanks
Martin
Try these changes...
1) Create SUB_CONNECTED_MONTH like this
Date(MonthStart(Date#(Right(SUBS_CONNECTED_DATE, 6)), 'MMM-YYYY') as SUB_CONNECTED_MONTH
2) Then try this expression
Count({<SUB_CONNECTED_MONTH = {"$(='<' & Date(Max(SUB_CONNECTED_MONTH), 'MMM-YYYY'))"}>}Distinct SUBS_NUMBER)
How do you create SUB_CONNECTED_MONTH in the script? Do you use MonthName function? Also, do you make selections in other date and time related fields?
Hi Martin ,
Create New Variable:
Settinng-> Variable Overview->Add
Varable name- VpreviousMonth
In Defination:
=AddMonths(MonthName(Today()),-1)
And use that variable in your expression:
Count({<SUB_CONNECTED_MONTH={"$(VpreviousMonth)"}>}Distinct SUBS_NUMBER)
Thanks,
Arvind Patil
Hi Sunny, yes I do. see below script:
SUBSCRIPTION_INVENTORY:
LOAD
SUBS_NUMBER,
Date(Date#(Right(SUBS_CONNECTED_DATE, 6), 'YYMMDD')) as SUBS_CONNECTED_DATE,
MonthName(Date(Date#(Right(SUBS_CONNECTED_DATE, 6), 'YYMMDD'))) as SUB_CONNECTED_MONTH
The original date being passed is from an IBM iseries so is in the format CYYMMDD hence the formatting.
This part of the app would be standalone so I would expect that selections should change the displayed value -= if thats what you mean?
Thanks
Martin
Hi Arvind, this would work in calculating the previous months totals but I am after all dates not equal to current month.
Thanks
Martin
Try these changes...
1) Create SUB_CONNECTED_MONTH like this
Date(MonthStart(Date#(Right(SUBS_CONNECTED_DATE, 6)), 'MMM-YYYY') as SUB_CONNECTED_MONTH
2) Then try this expression
Count({<SUB_CONNECTED_MONTH = {"$(='<' & Date(Max(SUB_CONNECTED_MONTH), 'MMM-YYYY'))"}>}Distinct SUBS_NUMBER)
Hi,
Set Analysis Syntax of not equal is : -=
=Count( Distinct {<SUB_CONNECTED_MONTH-={"$(vCurrentMonth)"}>} SUBS_NUMBER)
Thanks Sunny
Hi Sunny, I missed something off my first question but I thought I had it cracked. i tried to add in another selection criteria but it didnt seem to work?
=COUNT({<[SUBSCRIPTION_STATUS] = {'Connected'}>},SUB_CONNECTED_MONTH = {"$(='<' & Date(Max(SUB_CONNECTED_MONTH), 'MMM-YYYY'))"}>},Distinct SUBS_NUMBER)
This is asking for a date status as well. can you see whats wrong with it? i have tried all kinds of variations.
Thanks
Martin
You have an extra >} after the set analysis for SUBSCRIPTION STATUS... Try this
=Count({<[SUBSCRIPTION_STATUS] = {'Connected'}, SUB_CONNECTED_MONTH = {"$(='<' & Date(Max(SUB_CONNECTED_MONTH), 'MMM-YYYY'))"}>} DISTINCT SUBS_NUMBER)