Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
See this set analysis. I have 12 fields Jan.... Dec with values. how do i pick all these months in one expression?
Sum({<Year={2013}> Jan, Feb, Mar.... Dec ) How do i do this?
May be this:
Sum({<Year={2013}> (Jan+Feb+Mar+.... +Dec))
or
RangeSum(Sum({<Year={2013}> Jan), Sum({<Year={2013}> Feb), Sum({<Year={2013}> Mar), ....., Sum({<Year={2013}> Dec))
Hi,
You might want to consider changing the data model of your application to a vertical model rather than having a field for each month, that could possibly make your life a lot easier. QlikView has a CrossTable loading command specifically for this kind of dataset.
Regards,
Cesar
Would it be better to change your data model so the Month is a dimension and you just have one measure field?
Then you can select months in a list box along with year and use a simple expression such as sum(value) or
sum({<Year = {2013}>} Value)
Didnt work
As CesarAccardi suggests, look at the Cross Table function in your load script, and avoid having 12 value fields.
What i wanna achieve dont need the data model to be changed
Hi,
You can do this by following way.
Tab1:
SQL
Select Date,Month(Date) as Months,Sales From yoursqltable
Months:
Load * INLINE [
Months, Month
01, Jan
02, Feb
03, Mar
04, Apr
05, May
06, Jun
07, Jul
08, Aug
09, Sep
10, Oct
11, Nov
12, Dec
];
After reloading you qv document create the new list box and select the "Month" field on this list box.
Then your list box will display Jan,Feb,Mar,...,Dec.
or
DUAL(Month(YourDate), MonthName(YourDate)) AS Month
You can do it without changing the data model, but you will need to sum 12 expressions.
Sum({<Year={2013}> Jan) + Sum({<Year={2013}> Feb) + ... + Sum({<Year={2013}> Dec)
A well structured data model will be more efficient going forward.