Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Grouping in dimensions

Hi all,

I need a help for the below requirement.

I have the Month and product as dimension and sales as Expression.

Though the dimension is month i have to show th graph based on weekwise but in dimension it should be Month.

Ie. for Jan-15 there would be 4 weeks the n it should show the four points for  Jan 15 as continuos pints in a line graph.

Looks like.

Capture.PNG

16 Replies
Anonymous
Not applicable
Author

I would suggest, take Month as a Dimension,

and then define 4/5 expression for your Sales like:

Week1= sum({<Weekname={'Week 1'}>}Sales)

Week2= sum({<Weekname={'Week 2'}>}Sales)


Week3= sum({<Weekname={'Week 3'}>}Sales)    and so on...


Hope this will help!!

Gysbert_Wassenaar

A line chart cannot have three dimensions. Create a WeekStart field in the script from the date field using the WeekStart function, i.e. WeekStart(MyDate) as MyWeek, and use that new WeekStart field as dimension in your chart. Then set the dimension axis to Continuous on the Axes tab and set the Number format of the Continuous X-axis to Date with MMM/YY as date format on the Number tab.


talk is cheap, supply exceeds demand
NareshGuntur
Partner - Specialist
Partner - Specialist

Have you tried taking Week as well in the dimension?

Cheers,

Naresh

tresesco
MVP
MVP

Replace your Month dimension by calculated dimension, something like : =Dual (Month, Week)

Assuming there is a week field called Week in your data model.

Not applicable
Author

Hi,

Thanks a lot for your help.

It worked for me. but the Month name is repeated for each weeks.is there any possible way to show only one Month for four four weeks..?

Capture.PNG

Anonymous
Not applicable
Author

What I suggested that might not repeat the Months

tresesco
MVP
MVP

Try like:


=Dual(Aggr(NODISTINCT If(Week=Max(total <Month> Week), Month, ''), Month, Week), Week)

Not applicable
Author

Yea...but for me the weeks are defined with each weekending Date..so i have to write expressions for each and every week of the year....

Not applicable
Author

Thanks a lot...It worked..