Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is the order of the dimensions important when performing a calculated in Set Analysis?
In the example attached, I am trying to count the ID's where source='online' and SaleDate between the Variables- vMinTimeStamp and vMaxTimeStamp and ignore the dimension-source
I have defined the variebles-
Let vMinTimeStamp =Timestamp(min(SaleDate),'YYYY-MM-DD hh:mm:ss')
Let vMaxTimeStamp= Timestamp(max(SaleDate),'YYYY-MM-DD hh:mm:ss')
in Set Analysis I have tried:
=count({$<SaleDate = {">=$(vMinTimeStamp)<= $(vMaxTimeStamp)"},source ={'online'},source = >}ID)
but it's not working, becouse I want to ignore the dimension "source"
In addition, I noticed that if I write in the beginning of the Set Analysis: source =
like this:
=count({$<source = ,SaleDate = {">=$(vMinTimeStamp)<= $(vMaxTimeStamp)"},source ={'online'}>}ID)
the result is changing, why?? is the order in set analysis important?
My expectation should be displayed like this:
**if the user selects the sorce='email' - the result will not change,
the result will change only when the user selects SaleDate
Appreciates any help!
I think dreamer4 is right. Because your date change based on selection in source field, the value of the count also changes. I used this for the variables
vMaxTimeStamp
=Timestamp(max({<source>}SaleDate),'YYYY-MM-DD hh:mm:ss')
vMinTimeStamp
=Timestamp(min({<source>}SaleDate),'YYYY-MM-DD hh:mm:ss')
Hi,
It is showing as per logic you build.
On selection of email from source field your min value is changing because of that your end output is changing.
for that you have to nullify source = in variable definition.
Regards,
Prashant
I think dreamer4 is right. Because your date change based on selection in source field, the value of the count also changes. I used this for the variables
vMaxTimeStamp
=Timestamp(max({<source>}SaleDate),'YYYY-MM-DD hh:mm:ss')
vMinTimeStamp
=Timestamp(min({<source>}SaleDate),'YYYY-MM-DD hh:mm:ss')
What do you mean by "nullify source = in variable definition"
Can you show this in the example I attached?
Wow you are amazing !!
But,
In my original model, I have several Text Object , some of which I want to ignore the source dimension and some not,
How can i deal with this, when the user selects a date range?
update your variable definition as sunny suggested. nullify means ignoring your selection
min({<source=>}date).
regards,
Your initial expression used "source" twice, whenver you want to avoid a field value to be considered, use the same field with an equal and nothing on the right, like:
=count({$<source=, SaleDate = {">=$(vMinTimeStamp)<= $(vMaxTimeStamp)"} >} ID)
The filter for SaleDate will work but regardless what has been selected in field "source"
May be create two set of variables... one when you ignore selection in source and other where you don't
vMaxTimeStampIgnoreSource
=Timestamp(max({<source>}SaleDate),'YYYY-MM-DD hh:mm:ss')
vMinTimeStampIgnoreSource
=Timestamp(min({<source>}SaleDate),'YYYY-MM-DD hh:mm:ss')
vMaxTimeStamp
=Timestamp(max(SaleDate),'YYYY-MM-DD hh:mm:ss')
vMinTimeStamp
=Timestamp(min(SaleDate),'YYYY-MM-DD hh:mm:ss')
Maybe you can use this?
OK Sunny,
i can create two set of variables
but in the Input box in which the user selects date range, which variables I should put ?