Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Only(Year)-1) with Set Analysis (Aggr function) Problem

Hello everyone,

I have a problem with showing data in chart - straight table where I wanna show year to year messure.

Dimension = Month;

Expressions =

Only(Year)

sum(Aggr((sum({<Year={$(=Only(Year))}>}[PZ Poz. Wartość po korekcie])/Count({<Year={$(=Only(Rok))}>}distinct [ZAMD NR])),[Dostawca Skrót],[PZ Nr mag.],[PZ Symbol],[Data],[Indeks Linia],[Indeks Indeks] ,[Indeks Nazwa],[PZ Poz. Cena po korekcie],[KH_ID])) - and that's work fine

The problem begins with previous Year:

Only(Year)-1)

sum(Aggr((sum({<Year={$(=Only(Year)-1)}>}[PZ Poz. Wartość po korekcie])/Count({<Year={$(=Only(Year)-1)}>}distinct [ZAMD NR])),[Dostawca Skrót],[PZ Nr mag.],[PZ Symbol],[Data],[Indeks Linia],[Indeks Indeks] ,[Indeks Nazwa],[PZ Poz. Cena po korekcie],[KH_ID])) 

There are no results 😞

Please help

Thanks. 

 

1 Solution

Accepted Solutions
Highlighted
Contributor II
Contributor II

=sum({<Rok={$(=Only(Rok)-1)}>}Aggr((sum ({<Rok={$(=Only(Rok)-1)}>}[PZ Poz. Wartość po korekcie])/Count({<Rok={$(=Only(Rok)-1)}>}distinct [ZAMD NR])),[Dostawca Skrót],[PZ Nr mag.],[PZ Symbol],[Data],[Indeks Linia],[Indeks Indeks] ,[Indeks Nazwa],[PZ Poz. Cena po korekcie],KH_ID))/ if(vWaluta=1,vEUR,1)

 

THATS WORKING... 🙂 

View solution in original post

7 Replies
Highlighted

Have you made a selection in a year field? Try this

Sum({<Year = {$(=Only(Year)-1)}>} Aggr((Sum({<Year = {$(=Only(Year)-1)}>} [PZ Poz. Wartość po korekcie])/Count({<Year = {$(=Only(Year)-1)}>} DISTINCT [ZAMD NR])), [Dostawca Skrót], [PZ Nr mag.], [PZ Symbol], [Data], [Indeks Linia], [Indeks Indeks], [Indeks Nazwa], [PZ Poz. Cena po korekcie], [KH_ID])) 
Highlighted
Contributor II
Contributor II

Sunny_talwar 

Thanks for the answer.

I appreciate it.  

I try this ealier but the result is still no data in table. 

Do you have any other ideas?

Highlighted

Are you making selection in any other field except for Year field which is directly related to Year field? Like YearStart or MonthYear?

Highlighted
Contributor II
Contributor II

1.png2.png

 

Highlighted
Contributor II
Contributor II

This are all expressions in my table: 

 

Year in polish is ROK

 

year(today())-1 :

=sum({<Year={$(=year(today())-1)}>} [PZ Poz. Wartość po korekcie])

 

year(today()):

=sum({<Year={$(=year(today()))}>}[PZ Poz. Wartość po korekcie])

Highlighted
Partner
Partner

Have you tried to double quote your modifier?

=sum({<Year={"$(=year(today())-1)"}>} [PZ Poz. Wartość po korekcie])

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Contributor II
Contributor II

=sum({<Rok={$(=Only(Rok)-1)}>}Aggr((sum ({<Rok={$(=Only(Rok)-1)}>}[PZ Poz. Wartość po korekcie])/Count({<Rok={$(=Only(Rok)-1)}>}distinct [ZAMD NR])),[Dostawca Skrót],[PZ Nr mag.],[PZ Symbol],[Data],[Indeks Linia],[Indeks Indeks] ,[Indeks Nazwa],[PZ Poz. Cena po korekcie],KH_ID))/ if(vWaluta=1,vEUR,1)

 

THATS WORKING... 🙂 

View solution in original post