Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
C_Howarth
Contributor II
Contributor II

PY (selected month) sales

I am trying to write a expression to give me a months sales which is from the prior year based on selection made.

E.G Select Year 2017 month 05 then expression should give me sales for 2016 05, however the expression I have written is still bringing back sales for 2017 05

I have the following:

=sum({<[flag sample] = {0}, distributor_flag = {0}, [month description] = , [date] =, [year] = {"=$(=((GetFieldSelections(year)-1)))"}, [month] ={"=$(=(getfieldselections([month])))"}, [month code] = {"=$(=((GetFieldSelections(year)-1)) & (GetFieldSelections(month)))"}>}[oneforce sales]*[exchange rate])

 

1 Solution

Accepted Solutions
sunny_talwar

May be try this

=Sum({<[flag sample] = {0}, distributor_flag = {0}, [month description], [date], [month], [month code], [year] = {"$(=Max(year)-1)"}>} [oneforce sales] * [exchange rate])

 

View solution in original post

2 Replies
sunny_talwar

May be try this

=Sum({<[flag sample] = {0}, distributor_flag = {0}, [month description], [date], [month], [month code], [year] = {"$(=Max(year)-1)"}>} [oneforce sales] * [exchange rate])

 

View solution in original post

C_Howarth
Contributor II
Contributor II
Author

Excellent.

Had to change that very slightly to remove ignoring the selected month so:

=sum({<[flag sample] = {0}, distributor_flag = {0}, [month description] = , [date] =, [year] = {"$(=Max(year)-1)"} , [month code] =>}[oneforce sales]*[exchange rate])