Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I have 12 months data in db now i want data for 6 th month. how to write the set expression and and how to write the same query by using IF condition
Thanks In advance...
Whenever you ask a query here, try to create a sample qvw and share. This helps you get the solution faster, because without that there would be many assumptions and subsequent queries. I.e. - let the people know how your data look like and how exactly the output you are expecting to be. So, try to share a sample qvw.
HI,
Sum ({<year = {$(=max (year))}>} [budget amount]) - this is expression for max year right? so now
i want max year by using IF condition instead of set analysis
Then, you can try
If(year = Max(year), true statement, false statment)
Hi,
Hope you have date field. You can try with max(date).
Sum({<Date={‘>=$(=Addmonths(Max(Date), -6))<=$(=Date(Max(Date)))’}>} [budget amount])
In a text box, try like: Sum ( If(year =$(=max (year)), [budget amount]) )
Hi,
Set analysis is the best option for this type of scenarios, it has better performance over using If(). Not sure why you are not using the Set Analysis.
IF you really want then use below expression using Aggr()
Sum ( Aggr(If(year =Max(TOTAL year), Sum([budget amount]), 0), year))
Hope this helps you.
Regards,
jagan.