Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
boopeshj
Partner - Creator II
Partner - Creator II

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
dplr-rn
Partner - Master III
Partner - Master III

Whats the issue you are facing? Please elaborate

Seems like you answered your question with the 2 expressions

boopeshj
Partner - Creator II
Partner - Creator II
Author

Thanks Dilip. I have added some more details. 

dplr-rn
Partner - Master III
Partner - Master III

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?

boopeshj
Partner - Creator II
Partner - Creator II
Author

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. 

dplr-rn
Partner - Master III
Partner - Master III

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.
boopeshj
Partner - Creator II
Partner - Creator II
Author

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.