Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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])

 

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