Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hi Friends

I have a list box with the Year:2004,2005,2006,2007,2008,2010.

but when i select the list box any range of years which means 2005 to 2007 (Or) 2004 to 2008 i need total selected years of sum(sales)

using set analysis can any one help on this.

Regards,

Siva

9 Replies
Anil_Babu_Samineni

Set analysis has that future, No need to create for that

From here, If you select any thing either 2005 - 2007 then Sum(Sales) shows the 2005, 2006 & 2007 Data only. Same with 2004 - 2008

Simple use this -- Sum(Sales)

Or

Sum(TOTAL Sales)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
surendraj
Specialist
Specialist

OR

Sum({$}Sales)

Not applicable
Author

Hi Anil,

For Create a visualization hwre user has to "From Year" and "To Year". A text box should show a message as follows

for example From year 2004 and To year is 2007 the sales between the year of 2004 and 2007

Here is my question

Hope you understand

Thank you vary much

surendraj
Specialist
Specialist

In text box try this..

='For ' & GetFieldSelections(Year,'|') &   'Sale is ' & sum(sale)

or

='For ' & GetFieldSelections(Year,'|') &   'Sale is ' & sum({$}sale)

You can use your delimiter as ,(coma) or pipe...

Kushal_Chawda

in year selection box, provide search option. Click on search and type >=2007 <= 2009 (Make sure that year field is not text) and hit enter. All year in that range will get selected. 

surendraj
Specialist
Specialist

Try with this...its working fine compared to my previous expression..

='The sales between the Year of' & Chr(39)  & SubField(GetFieldSelections(year,'|'),'|') & Chr(39)  & 'To Year'  & Chr(39) & SubField(GetFieldSelections(year,'|'),'|',GetSelectedCount(year)) &'='&sum(sale)

vinieme12
Champion II
Champion II

a simpler Expression would be

=if(GetSelectedCount(Year)>1,'Sales From' & Min(Year) &' to ' & max(Year) & ' is : ') & Sum(Sales)

Anil_Babu_Samineni

Vineeth Solution Should work

Still you are looking

='Sales Between the Year of ' & Min(Year) & ' And ' & Max(Year) &  ' Is ' & Sum(Sales)

If solve your issue as you expected, Then close the Thread by flag of Correct answer

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
muthukumar77
Partner
Partner

Hi,

create 2 varibles ,

vFromYear and vToYear


assign,

vFromYear = 2004

vToYear= 2008

expression,

=sum({<Year={">=$(vFromYear)"},Year={"<=$(vToYear)"}>}Sales)

Muthukumar Pandiyan