Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Partner
Partner

Display different sum

I have to total a sales value. One expression should show sales based on the selection of the year. 

Other one should always show a particular year. 

eg: Sum(<{Year={2015}><year={2015}>}Sales) -- This value should always show for 2015</year={2015}>

Sum(Sales) -- This should change according to my Year Selection. 

Currently when I select any year except 2015 the expression 1 returns 0. 

Any help is much appreciated. 

Labels (1)
6 Replies
Partner
Partner

Re: Display different sum

Whats the issue you are facing? Please elaborate

Seems like you answered your question with the 2 expressions

Partner
Partner

Re: Display different sum

Thanks Dilip. I have added some more details. 

Partner
Partner

Re: Display different sum

still confused.

Sum({<{Year={'2015'}>}Sales) should return 2015 data always regardless of what year you select.

How do you want to display it? Is it a KPI? or 2 KPIs

do you want to display 2015 if nothing is selected but the year if something is selected?

Partner
Partner

Re: Display different sum

It is acatually a Table. 

Sales 1 should change according to the year selection. 

Sales 2 should always show 2015.

Dim 1 , Dim 2 , Sales 1 , Sales 2

there are other dim conditions in my KPI as well. 

Partner
Partner

Re: Display different sum

Same expressions should work unless you have date fields as a dimension. if you have date fields you may need to use total qualifier

https://community.qlik.com/t5/Qlik-Design-Blog/What-does-the-TOTAL-qualifier-do/ba-p/1472990

Share what dimensions that you are using and i maybe able to help.
Partner
Partner

Re: Display different sum

Actually Year was taken as an example. 

 

I am using a Dimension field which has multiple values. 

Snapshot (Field name) 

Current

Jan 2019

Feb 2019 

Mar 2019 

 

So I am trying to have 2 expressions 

1) Sum({<Snapshot={'Current'}, Dim1={'Value'}>} Sales)

2) Sum({<Dim1={'Value'}>}Sales)

So in this when I select Snapshot from list box  Feb 2019 then expression 1 should should sum of sales for current and expression 2 should show sales for Feb 2019. 

 

Thanks Dilip for your time.