Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i need a chart calculation which is sum (sales) has to shown for latest 10 days by default if there is no date selection made. if any date selection done then show accordingly. attached the sample data. Please help.
TIA
Apologies, I forgot to save the file.
Here is the saved one.
Try this,
Sum({<Date = {">=$(=Max(Date)-10)"}>}Sales)
Hi Kaushik,
Thanks and yes this is working fine. But the problem is. i have 10 fields in the data file. when user opening the dashboard there wont be any selections. if during that time only i want to latest 10 days data in my chart if started selecting the fields then my measure must show the values as per the selection.
Eg: i want my expression is something like this
if ("no filter selected" then Sum({<Date = {">=$(=Max(Date)-10)"}>}Sales) else sum(Sales))
not sure how to get the red colour expression
TIA
Hi,
In such case, you can create a variable say vFilter
vFilter will have an expression like below.
=If(GetSelectedCount(Date)=0,'<Date = {">=$(=Date(Max(Date)-10))"}>','$')
And use this in the expression like below.
Sum({$(vFilter)}Sales)
Hi Kaushik,
Thanks for your prompt reply. this one gives me '0' values. i am not sure how to call the variable in set analysis.
Here is the qvf file for your reference.
Hi Kaushik,
no sheet in your qvf and attached the qvf with sheets which has no values in sales measure (Variable measure).
PFA
hi kaushik,
Actually, the below expression is working fine. but if user selection is not from the date then its not working.
=If(GetSelectedCount(Date)=0,sum({<Date = {">=$(=Max(Date)-10)"}>}sales),sum(sales))
Apologies, I forgot to save the file.
Here is the saved one.
Hi Kaushik,
its not working if i check year and month field. update the file with extra data as attached. please refer bookmark for my selection.