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

weekly dimension for line/area chart?

I'm trying to learn Qlik Sense (Cloud version).

What kind of expression would I use to create a weekly dimension for a line/area chart, where the first week starts on a date specified by the user?

Regards,

Chris

2 Replies
benvatvandata
Partner - Creator II
Partner - Creator II

Hi Chris,

This sounds somethings like:

- create 2 variables: vStartDate, vEndDate

- create 2 calendar objects: 1st object choose vStartDate variable as the field to use, 2nd object choose vEndDate variable... for the Min and Max boxes in both calendar objects, you can put something like: =Min(YourDateField), =Max(YourDateField)... after this is completed, the user should now have 2 calendar objects to define the range you want your line chart to reflect

- In the line chart, add a calculated dimension: Week(YourDateField)

- In the expression, add: Sum({< YourDateField = {">=$(=Date(vStartDate))<=$(=Date(vEndDate))"} >} ValueField)

Hope this helps.

Thanks,

Ben

benvatvandata
Partner - Creator II
Partner - Creator II

If you only need a start date, then just change your expression to: Sum({< YourDateField = {">=$(=Date(vStartDate))"} >} ValueField)