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
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
delbooth
Contributor II
Contributor II

Date from filter

Hi.

I have a date filter called ColMonth (Jan, Feb, Mar....Dec) and use it to generate a table for different months.  I want to compare two months a selected one and the previous ie Select March and compare it with February.

I have tried using ColMonth = Colmonth-1 in a set analysis but it does not work, I have tried

month(makedate(ColYear, ColMonth-1))  on its own and it goes me the the month 2 but when used in a set expression it does not work,

Thanks

3 Replies
supriyabiware
Creator
Creator

Hi,

try checking this.

QlikView App: Set Analysis - Prior Period Comparison

Thanks,

Supriya.

agigliotti
Partner
Partner

maybe this:

{< ColMonth = {"=Max(ColMonth)-1"} >}


I hope it helps.

OmarBenSalem
Partner
Partner

Add a date field:

load Date(Monthstart(Date#(Mois,'MMM')),'DD/MM') as Date,Mois, Sales Inline [

Mois, Sales

Jan, 100

Feb, 200

Mar, 300

];

then use this measure:

sum({<Mois, Date={"$(=date(AddMonths(max(Date),-1),'DD/MM'))"}>}Sales)


If u select Feb, u'll have the sales of Jan; if u select Mar, u'll have the sales of Feb etc:

Capture.PNG

Capture.PNG

For variation :

(sum({<Mois, Date={"$(=date((max(Date)),'DD/MM'))"}>}Sales)

-

sum({<Mois, Date={"$(=date(AddMonths(max(Date),-1),'DD/MM'))"}>}Sales))

/

sum({<Mois, Date={"$(=date(AddMonths(max(Date),-1),'DD/MM'))"}>}Sales)


Result:

Capture.PNG

Capture.PNG