Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm attempting to build an expression using the count function that shows me the count for a dimension based on a date. The current expression I have is as follows:
=Count({$<[POS Date]={'10/31/2014'}>}[Instrument Type])
Any idea why it does not work?
The set expression search string needs to be closed with a double-quote.
=Count({$<[POS Date]={"$(=Date#('10/31/2014','MM/DD/YYYY'))"}>}[Instrument Type])
However, there is no point in making a static calculation like =Date#('10/31/2014','MM/DD/YYYY') in the set expression. This will only result in a text looking like 10/31/2014, meaning that the calculation just makes the expression look more complex and wastes time for one calculation. Just write the date direct in the expression, and this is equal to the expression above.
=Count({$<[POS Date]={"10/31/2014"}>}[Instrument Type])
Hi,
it could be easier to help you, if you can upload a little sample of your data,
regards
Essentially what I'm trying to do is
Select Count(Instrument Type)
from <table)
where POS Date = '10/31/2014'
group by Instrument Type
Does this make sense?
Hi =count({$} [Instrument Type]) Your set Analysis seems to be ok in terms of syntax and should not have a syntax error Do you have a zero value return. if so this means the condition found no data and maybe you should remove the $ for having the current selection Try this =count({} [Instrument Type]) Thanks Ziad
Sorry Try this count({} [Instrument Type])
=count({<[POS Date] ={'10/31/2014'}>} [Instrument Type])
I am not sure why the editor removes the single qoute
but anyway try removing the $ sign of the current selection
The outcome of an expression will always depend on the dimension(s) that you use. The dimension and expression will then depend on your data model, so with all the details it is hard to advise on how you can address the issue.
If you can provide a simple sample QVW file with a description of you expected result, it will be possible to determine why you get your current results and also advise on changes to get your expected result
PFA
Is format of [POS Date] is 'MM/DD/YYYY' ?
If [POS Date] is date then try this
=Count({$<[POS Date]={"$(=Date#('10/31/2014','MM/DD/YYYY'))}>}[Instrument Type])
Anbu,
I tried that syntax and am seeing a syntax error with the parens. See screen grab below:
From what I can see the Parenthesis line up.