Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
lankmachine
Partner - Contributor II
Partner - Contributor II

Using Set Analysis to Filter a Histogram by Date

Hello,

I'm trying to create a histogram from my data that selects for only the current date. 

Currently, I have this as my "Field":

={<[DATE_FIELD] = {"$(=Date(Today(), 'M/D/YYYY'))"}>} [VALUE_FIELD]

But this isn't filtering out the other dates. Is there another approach I should be taking?

Thanks in advance!

Labels (1)
2 Replies
hic
Former Employee
Former Employee

You must use an aggregation function somewhere. Otherwise the set analysis won't work.

For example, you can use this as measure:
={<DATE = {"$(=Date(Today(), 'M/D/YYYY'))"}>} Sum(VALUE)

And you can use this as dimension:

=Aggr({<DATE = {"$(=Date(Today(), 'M/D/YYYY'))"}>} Only(DATE),DATE)

Further, if you have the correct DateFormat in the script, e.g.
SET DateFormat='M/D/YYYY';

then you don't need the formatting function in your set expression. Today() returns the correct format, so you can use
={<DATE = {"$(=Today())"}>} Sum(VALUE)

lankmachine
Partner - Contributor II
Partner - Contributor II
Author

For the histogram, I'm not seeing any dimensions or measures that I can change. There are only fields, which I can add several to.