Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
C_Howarth
Contributor II
Contributor II

PYQuarter (Selected month) sales

Following on from my now answered question here: https://community.qlik.com/t5/New-to-Qlik-Sense/PY-selected-month-sales/td-p/1619942

I am now trying to apply similar logic but to get the sales for the Prior Year quarter based on the selected Year and Month

So if selection Year 2018 Month 05 is made it will bring back sales for Year 2017 Quarter 02

I have tried a few different ways of doing this:

sum({<[flag sample] = {0}, distributor_flag = {0}, [month description] = , [month] = {"<=$(=GetFieldSelections([month]))"}, [quarter code] = {"=$(=(GetFieldSelections([year]))-1 & 0 & ceil(sum(GetFieldSelections([month])/3)))"}>}[oneforce sales] * [exchange rate]) <--- This one brings back the correct Quarter sales but for the Selected year not the Selected year - 1

Sum({<[flag sample] = {0}, distributor_flag = {0}, [month description] = , [month] = {"<=$(=GetFieldSelections([month]))"}, [year] = {"$(=Max(year)-1)"}, [quarter] = {"=$(='QTR 0' & ceil(sum(GetFieldSelections([month])/3)))"}>}[oneforce sales] * [exchange rate])   <--- This one doesnt seem to work at all and just brings back a "0"

0 Replies