Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys.
I've a Table like this
InsertDate; .....; YearWeekNumber
I want to show simply an istogram with 2 bar: for each week of the year, Count record inserted previous year vs current year.
So i wrote two new measure:
Count({<Year={"$(=Max(Year)-1)"}>} InsertDate) // as previous year
Count({<Year={"$(=Max(Year))"}>} InsertDate) // as current year
I've also tried using SUM instead COUNT but for both cases, i got SAME numbers...
What i wrong ?
Thanks
Hi @stighy
Always when validating set analysis statements create a table with all of the fields used in the statement, so have Year and InsertDate as dimensions and your two expressions as measures. This will then show you what values are being counted against which dimensions.
When you say you got the same numbers, is that the total for all years or the value for the same year, or something different again?
Assuming that the field Year contains an integer year and InsertDate appears on every row you want to count I can't see anything wrong with the statement. The double quotes are superfluous, as you are matching to an exact number, but they shouldn't break anything.
This blog post has a description of a prior period comparison, and a link to apps with fully working examples:
https://www.quickintelligence.co.uk/prior-period-comparison/
Hope that helps.
Steve
Can you provide us your working QVF with scramble data.