Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day everyone,
I have a set of data that captures production in daily and month interval.
I would love to visualize the data showing latest( current) day production vs previous date productions as well as current month vs previous month.
Sample data ( current month vs previous month)
Year | Month | Station | Figure (Kg) |
---|---|---|---|
2010 | January | Edo | 56,000 |
Delta | 67,000 | ||
February | Edo | 78,000 | |
Delta | 69,000 |
Sample Data (cuurent day vs previous day)
Date | Edo | Delta | Lagos |
---|---|---|---|
2013/09/29 | 30 | 50 | 100 |
2013/09/30 | 60 | 25 | 150 |
Thanks
Are you running into an issue? I wasn't sure what the problem is by reading your post?
Hello sunny... Thanks for your response
My challenge is how to approach it.. (write the script)
I could use the point in time reporting/ set analysis approach but I don't know if you have a better approach
thanks
Thanks I just looked at the blog you linked.. The 'as of month' approach is not quite giving me my desired approach.
Look at it this way... ( Saw this in a book 'Qlikview 11 for developers' written by M. Garcia, Barry Harmsen )
To embed actual calculations into the field value definition in a set expression, we use the Dollar Sign Expansion (DSE) syntax. The final expression would be as follows:
Sum({$<Year = {$(=Max(Year))}>} [# Departures Performed])
If we want to get the record set corresponding to the previous year to whatever year the user selects, we would use:
Sum({$<Year = {$(=Max(Year)-1)}>} [# Departures Performed])
In the expression above, they were able to compare present year figures with previous year figures
I need to do such for present day vs previous day as well as present month vs previous month
Thanks
Is date or month one of the dimensions in the chart you are wanting to compare the two?
Yes..
My desired design is to use two gauges ( on showing present value) and the other (showing previous month/day value)
Regards
So there is no dimension then? You can use set analysis in that case....
Previous Day
Sum({<Date = {"$(=Date(Max(Date) - 1))"}>} Measure)
Previous Month
Sum({<Date = {"$(='>=' & Date(MonthStart(Max(Date), -1)) & '<' & Date(MonthStart(Max(Date))))"}>} Measure)
Alright sir
And I guess the current day is
Sum({<Date = {"$(=Date(Max(Date) ))"}>} Measure)
and
current month
Sum({<Date = {"$(='>=' & Date(MonthStart(Max(Date), )) & '<' & Date(MonthStart(Max(Date))))"}>} Measure)
right?
Current month would be something like this
Sum({<Date = {"$(='>=' & Date(MonthStart(Max(Date), 0)) & '<' & Date(MonthStart(Max(Date), 1)))"}>} Measure)