Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I hope someone out there can help me with this.
I have 3 fields- Month, region, sales.
I want to see a bar chart with only the previous month's sales with the Region on x-axis.
For ex, if the data I have is this:
Month | Region | Sales |
---|---|---|
mar | north | 78518751 |
june | north | 28632982 |
june | west | 2378638 |
june | central | 2369386 |
july | south | 8136328 |
june | south | 3863893 |
Now I want to see a bar chart which shows values (north, west, central, south) on x-axis (Since June is the previous month) with respective values on the bars.
Thank you.
Hi Divya,
Attaching two possibilities for your query. please see attached QVW.
If Month is a dual field, you can try this:
Sum({<Month = {"$(=MaxString(Month, 2))"}>} Sales)
Alternatively, I prefer using a date field over a month field. Do you have a date field in your application?
Sum({<DateField= {"$(='>=' & Date(MonthStart(Max(DateField), -1), 'DateFieldFormatHere') & '<=' & Date(MonthEnd(Max(DateField), -1), 'DateFieldFormatHere'))"}>} Sales)
Hi Divya,
Attaching two possibilities for your query. please see attached QVW.
This works. Just that I had to apply the condition on the dimension rather than the expression. Thank you.
Glad to help
Cheers
V