Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
chrismtb
Creator
Creator

Week On Week comparison (with set analysis??) to show increase

Hi,

I have looked through the forums and managed to partially solve my problem - I think however I have an opportunity to improve my solution for my users.

My data set currently comprises of the following information (example below):

Login IDDate
101/01/16
201/01/16
301/01/16
202/01/16
303/01/16
403/01/16

My aim was to create a week on week comparison of the increase in users for this I ended up creating, importing and using an AsOf table which allowed me to use the following expression to create a chart:

=if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User)))

this produced a chart looking something like this:

WoW Usage.JPG

which answers my original question.

HOWEVER now I would like to make it much easier to see the increase. I want to split the graph into stacked bars where the lower bar shows the baseline from the previous week and the upper bar represents the increase

i.e.

WoW Usage 2.JPG

The change obviously requires two expressions and no doubt will involve aggregation / set analysis but that is where I start to reach my limit on knowledge - any suggestions?

1 Solution

Accepted Solutions
sunny_talwar

Check the attached

Capture.PNG

Expression 1:

=Above(if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User))))

Expression 2:

=if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User)))-Above(if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User))))

View solution in original post

5 Replies
sunny_talwar

Would you be able to provide the sample you have been working with? Might be easy if we can also play around with it?

chrismtb
Creator
Creator
Author

Sunny T,

An example QVW attached as suggested.

Apologies - I have added the data straight from my actual data-source as in-line tables so there is a lot in there... but it was quicker to add it all.

Also to note as these are in-line tables I have pre populated the Week No. conversion of the date although I just handle this as a calculation in the load script in my proper file.

Hope this gives enough context now?

sunny_talwar

Check the attached

Capture.PNG

Expression 1:

=Above(if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User))))

Expression 2:

=if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User)))-Above(if([AsOfWeek]<Week(Now(2)),count(DISTINCT(User))))

chrismtb
Creator
Creator
Author

Great thanks Sunny T - as so often proved to me the answers are right there as long as you know the syntax to use!

Anonymous
Not applicable

Will I be able to choose a week in the past as "AsofWeek" in which I want to compare the data for?

 Thanks