# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
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]))

Thanks.

1 Solution

Accepted Solutions
Contributor II
Author

=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... 🙂

7 Replies
MVP

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])) ``
Contributor II
Author

Sunny_talwar

I appreciate it.

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

Do you have any other ideas?

MVP

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

Contributor II
Author

Contributor II
Author

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])

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
Contributor II
Author

=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... 🙂