Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

masalepp
New Contributor

Qlik Sense Comparison to previous period Set analysis

Hi,

I have hard time getting my bar chart working as I would like to. What I would like, is to have a previous period from my selections next to the bar of current selections.

The formula i have now:

Count({<[Document Timestamp.autoCalendar.InYTD]=,[Document Timestamp.autoCalendar.Month]=,

[Document Timestamp.autoCalendar.Date]={">=$(vMinDateLastPeriod)<=$(vMaxDateLastPeriod)"}>}DISTINCT Key_SessionCounter)

I have put my variables to their own KPI boxes and they work fine.

Could someone explain why my formula is not working?

14 Replies
YoussefBelloum
Esteemed Contributor

Re: Qlik Sense Comparison to previous period Set analysis

Hi,

Would you be able to share the expressions of your variables (vMinDateLastPeriod and vMaxDateLastPeriod) ?

masalepp
New Contributor

Re: Qlik Sense Comparison to previous period Set analysis

Hi,

AddMonths(min(date([Document Timestamp.autoCalendar.Date])),-12) 

AddMonths(max(date([Document Timestamp.autoCalendar.Date])),-12) 

YoussefBelloum
Esteemed Contributor

Re: Qlik Sense Comparison to previous period Set analysis

Before going to the previous period, do your Actuals bars display correctly ?

for me: vMinDateLastPeriod IS OK, but vMaxDateLastPeriod is not ok. because both will be rolling 12 months back..

sasiparupudi1
Honored Contributor III

Re: Qlik Sense Comparison to previous period Set analysis

Try


Count({<[Document Timestamp.autoCalendar.InYTD]=,[Document Timestamp.autoCalendar.Month]=,

[Document Timestamp.autoCalendar.Date]={">=$(=vMinDateLastPeriod)<=$(=vMaxDateLastPeriod)"}>}DISTINCT Key_SessionCounter)

masalepp
New Contributor

Re: Qlik Sense Comparison to previous period Set analysis

Hi, Yes the actual bars shows correctly. But previous shows zeros.  The variables show correct dates. So if I choose 2018 the variables will give me 1.1.2017 and 31.12.2017 and that is correct. So the set analysis should count the values between those dates.

masalepp
New Contributor

Re: Qlik Sense Comparison to previous period Set analysis

did not work   thank you anyways for trying.

YoussefBelloum
Esteemed Contributor

Re: Qlik Sense Comparison to previous period Set analysis

Would you be able to share sample QVF or attach some sample data here ?

sasiparupudi1
Honored Contributor III

Re: Qlik Sense Comparison to previous period Set analysis

Does it return values if you hardcode the dates into set analysis?

masalepp
New Contributor

Re: Qlik Sense Comparison to previous period Set analysis

no it does not. so maybe its a format thing?

Community Browser