Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Champion
Champion

Hi,

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

Anonymous
Not applicable
Author

Hi,

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

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

YoussefBelloum
Champion
Champion

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
Master III
Master III

Try


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

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

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

did not work   thank you anyways for trying.

YoussefBelloum
Champion
Champion

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

sasiparupudi1
Master III
Master III

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

Anonymous
Not applicable
Author

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