Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Last 4 weeks data in bar chart

Hi all,

I need to display weekly count bars for client specific.

Each bar for one week so i need to display total 16 bars 4 for one client.

I have attached the sample .qvf anyone help on this.

Thanks,

Kumar

1 Solution

Accepted Solutions
vigneshvs
Contributor II

Re: Last 4 weeks data in bar chart

Hii,

PFA the resulted output.

Hope this is what you required.

Thanks,

Vignesh

15 Replies
MVP
MVP

Re: Last 4 weeks data in bar chart

HI,

Check this link for set analysis expressions, use Client and Week as dimensions.

Set Analysis for certain Point in Time

Regards,

jagan.

Not applicable

Re: Last 4 weeks data in bar chart

jagan, How can i use two dimensions?

Dimension:If(match(client_id,'15','12','13','19','6'),client_id)

Measures:

1. count({$<Year=, Quarter=, Month=, Week=, Date={‘>=$(=WeekStart(Today(), -3))<=$(=Today())’},

DateType = {invitation}>} invitation_id )

2. count({$<Year=, Quarter=, Month=, Week=, Date={‘>=$(=WeekStart(Today(), -3))<=$(=Today())’},

DateType = {accessed}>} Landing_page_accessed)

And i need weeks as bar and x-axis labels as client and legend should be the last 4 weeks dates representing the bars.

I'm bit confused please explain it

Can anyone explain this.

reddys310
Honored Contributor II

Re: Last 4 weeks data in bar chart

Hi Promodgc3,

Will concatenating these two dimensions into one dimension solve your issue?

And it would be easier to solve the issue, if you can provide a sample file.

Not applicable

Re: Last 4 weeks data in bar chart

I have attached the sample qvf file. please check and help on it.

reddys310
Honored Contributor II

Re: Last 4 weeks data in bar chart

Hi Promodgc3,

One of the dimensions is the client_id, which is the other dimension you need?

Not applicable

Re: Last 4 weeks data in bar chart

week_group.

For those clients i need last 4 weeks data.

Dimension:

1. =If(match(client_id,'15','12','13','19','6'),client_id)

2. Week_group

Measures:

count({< DateType = {invitation}>}invitation_id)

4bars for each client. each bar showing the count of that week.

and also i need to customize the bars colour : : Light Gray, Dark Gray, Light Blue & Dark Blue.

Advance thanks,

Please help on it

reddys310
Honored Contributor II

Re: Last 4 weeks data in bar chart

Hi Pramodgc3,

Can you please add the below code to your script to flag the last 4 weeks?

Capture.PNG

Not applicable

Re: Last 4 weeks data in bar chart

error.png

Getting error while i load.

if ((week_number > (week(today()) - 4)),1,0) as last4weeks;

reddys310
Honored Contributor II

Re: Last 4 weeks data in bar chart

Hi Promod,

Sorry id I am being silly, did you miss a semicolon there?

And the last Conocial date for 2015 is no updated I beleive?

Capture.PNG