Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

4 weeks data

Hi all,

I have attached the sample data.

I need bar graph on week basis, last 4 weeks data.

and also for last week. please help me.

Untitled.png

Thanks,

Pramod

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I right I forgot. Here's the script I used to create some date fields:

Data:

LOAD *,

  week(date_created) as week,

  weekstart(date_created) as weekstart,

  weekyear(date_created) as year;

LOAD invitation_id,

     date#(left(date_created,10),'YYYY-MM-DD') as date_created,

     time#(mid(date_created,12,8),'hh:mm:ss') as time_created,

     client_name,

     course_completed,

     user_signed

FROM [comm162892.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

The field weekstart is used as chart dimension. To make sure to get the last four weeks including the selected week a set analysis expression is used to select the right date interval:

count({<weekstart={">$(=date(max(weekstart)-28))<=$(=max(weekstart))"}>}invitation_id)

I hope that gives you enough information to create the bar chart you need in Qlik Sense.


talk is cheap, supply exceeds demand

View solution in original post

15 Replies
Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

hi Gysbert Wassenaar,

can i know how to open this .Qvw file in qlik sense.

Thanks,

Pramod

Gysbert_Wassenaar

I right I forgot. Here's the script I used to create some date fields:

Data:

LOAD *,

  week(date_created) as week,

  weekstart(date_created) as weekstart,

  weekyear(date_created) as year;

LOAD invitation_id,

     date#(left(date_created,10),'YYYY-MM-DD') as date_created,

     time#(mid(date_created,12,8),'hh:mm:ss') as time_created,

     client_name,

     course_completed,

     user_signed

FROM [comm162892.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

The field weekstart is used as chart dimension. To make sure to get the last four weeks including the selected week a set analysis expression is used to select the right date interval:

count({<weekstart={">$(=date(max(weekstart)-28))<=$(=max(weekstart))"}>}invitation_id)

I hope that gives you enough information to create the bar chart you need in Qlik Sense.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert Wassenaar,

If possible please send the .qvf file. it is helpful.

Thanks,

Pramod

Not applicable
Author

Hi Gysbert Wassenaar,

Thanks a lot it's working fine.

Would you please tell me how to use for last one week data.

Thanks,

Pramod

Gysbert_Wassenaar

I'll give you a hint : 28 is the number of days in four weeks.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert Wassenaar,

THANKS A LOT, one more doubt.

I need these values in %. please help.3.png

Like this,

values varies in the above images.

Thanks,

Pramod

Gysbert_Wassenaar

Ok, you have an expression something like count({...} value ). Change that into count({...} value ) / count(TOTAL {...} value )


talk is cheap, supply exceeds demand
Not applicable
Author

hi,

i like sol

akansha