Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
1) Can you please explain about those values which are showing up in the previous month sales and previous month count field without doing any selection.
As far my understanding when we don't make any selection for the year it takes the max year and provide the values of the previous year. But I didn't understand about the values present in other fields. How and why those fields are generating those values without making any selection.
I also see the previous month number is higher than previous year.
Can any one explain what actually happening and what are those values.
These are my set expressions
for Previous month
Sum
(
{$
< Date={">= AddMonths(MonthStart(Max(Date)),-1)<MonthStart(Max(Date))"}>
}
Cost
)
<iframe src="http://localhost:4848/single/?appid=C%3A%5CUsers%5CA%5CDocuments%5CQlik%5CSense%5CApps%5CPatient%20C..." style="border:none;width:100%;height:100%;"></iframe>
Thanks
Hi, as said before you need to use the Date field name, I see two fields in you app that can be a date: DateKey and DayDate.
Also if you want to select a month or select january and show the value of december of last year... or anything that you want data that changes your selcted values, you also need to exclude this fields from selections, so at the end you can use an expression like:
Sum
(
{$
< DayDate={">=$(=Date(AddMonths(MonthStart(Max(DayDate)),-1)))<$(=Date(MonthStart(Max(DayDate))))"},YearMonth,YearNum>
}
Cost
)
If you don't add YEarMonth to ignore field selctions it will apply this selctions and the filter for dates, so if you select aug-2019 it will try show values with dates for july-2019 and with month aug-2019, and there will be no data that accomplish both.
Hi, try with:
Sum
(
{$
< Date={">=$(=Date(AddMonths(MonthStart(Max(Date)),-1)))<$(=Date(MonthStart(Max(Date))))"}>
}
Cost
)
Thanks for the reply.
But Its still showing the current month cost(i.e. selected Month) . I don't understand whats going wrong.
Just attaching the screenshots please look at them and reply.
In the Script editor page after writing expression it should show the values it going to be displayed but in this case nothing is displayed.
ThanksYou can also see in the bottom left in box . its nothing populated for the expression we written.
Thanks for the reply.
But Its still showing the current month cost(i.e. selected Month) . I don't understand whats going wrong.
Just attaching the screenshots please look at them and reply.
In the Script editor page after writing expression it should show the values it going to be displayed but in this case nothing is displayed.
Thanks
You can also see in the bottom left in box . its nothing populated for the expression we written.
Hi, 'Date' is in blue, if there was a field called 'Date' it should be shown as orange (like 'Cost'), so you need to create the Date field or use the field name for dates.
Sum
(
{$
< DateFieldName={">=$(=Date(AddMonths(MonthStart(Max(DateFieldName)),-1)))<$(=Date(MonthStart(Max(DateFieldName))))"}>
}
Cost
)
Hi Sir,
I attached the link for my app. I need a set expression for previous year cost or previous year count.
If possible can you also explain how the expression works please.
Thanks
Hi, as said before you need to use the Date field name, I see two fields in you app that can be a date: DateKey and DayDate.
Also if you want to select a month or select january and show the value of december of last year... or anything that you want data that changes your selcted values, you also need to exclude this fields from selections, so at the end you can use an expression like:
Sum
(
{$
< DayDate={">=$(=Date(AddMonths(MonthStart(Max(DayDate)),-1)))<$(=Date(MonthStart(Max(DayDate))))"},YearMonth,YearNum>
}
Cost
)
If you don't add YEarMonth to ignore field selctions it will apply this selctions and the filter for dates, so if you select aug-2019 it will try show values with dates for july-2019 and with month aug-2019, and there will be no data that accomplish both.