Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day everyone,
I have a set of data in this form
S/N | Product | Actual | Target | Date | Contract Type |
---|---|---|---|---|---|
1 | Soap | 400 | 500 | 01/01/2016 | SB |
2 | Rice | 5000 | 10000 | 01/01/2016 | SB |
3 | Soap | 670 | 800 | 01/01/2017 | JB |
4 | Soap | 1300 | 2000 | 01/06/2016 | SB |
5 | Rice | 1400 | 3000 | 01/06/2017 | JB |
In my attempt to show sales for all products for the current year and previous year.. I used these expressions:
Sum({<Year = {"$(=Max(Year))"}, Year >} Actual ) and Sum({<Year = {"$(=Max(Year)-1)"}, Year >} Actual) but my result is showing the same value?
I also used this expression Max(Aggr(Sum(Actual), Date)) to show the maximum actual sales values. It worked but I need to narrow it down to particular products like max actual sales for soap only?
Please can you help me review the expressions?
Regards
Remove Year field from expression.
Sum({<Year = {"$(=Max(Year))"} >} Actual )
and
Sum({<Year = {"$(=Max(Year)-1)"} >} Actual)
Are you going to ignore the Year selection in analysis?
Sum({<Year = {"=Only({$<Year=>} Year) = $(=Max(Year))"}, Year >} Actual )
Sum({<Year = {"=Only({$<Year=>} Year) = $(=Max(Year)-1)"}, Year >} Actual)
And Here we go for restrict the data to only one Product
Max(Aggr(Sum({<Product = {"Soap"}, Year=>} Actual), Date))
Hello Anil
I am using the year selection.
load*,
'Q'&ceil(month(date#([Month],'MMM'))/3) as [Quarter],
'Day '&Day("Date")&' '&Month as [Day Number];
load*,
Year("Date") as Year,
Month("Date") as Month,
Day("Date") as Day;
I used the above script to convert date into year
That is what my expression do, Here, Year can exclude the selection for analysis.
Find the atatched and have a look on the expressions on the chart.