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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
amrutha_sathish
Contributor II
Contributor II

Set analysis Expression for Aggregated data from the last 4 weeks

Can somebody suggest a  Set analysis Expression for Aggregated data from the last 4 weeks based on the dimension 'Channel'.

Thanks in advance.

Labels (6)
1 Solution

Accepted Solutions
joaopaulo_delco
Partner - Creator III
Partner - Creator III

OK, I'll try to explain.

       A date field is actually a number, but the mask shows in a date format.

As a number, you can do mathematical expressions like + or -.

Let's suppose that today is 07-11-2023, so if you use some expression adding 3, the return will be 07-14-2023.

I used "-28" in the expression because it is exactly the number of days of 4 weeks.

the function today(1) return the date of the latest data reload.

You can check this link https://help.qlik.com/en-US/sense/May2023/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunc...

 

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

3 Replies
joaopaulo_delco
Partner - Creator III
Partner - Creator III

Hi @amrutha_sathish !

        Using a table object, you can add the "Channel" dimension and add the follow measure:

Sum({<YourDimensionDate={"$(=(Date(today(1)-28)))"}>} YourValue)

Help users find answers! Don't forget to mark a solution that worked for you!
amrutha_sathish
Contributor II
Contributor II
Author

Hi, can you please explain the set analysis expression. i mean i'm just curious to know why are we doing 'Date(today(1)-28'....?

joaopaulo_delco
Partner - Creator III
Partner - Creator III

OK, I'll try to explain.

       A date field is actually a number, but the mask shows in a date format.

As a number, you can do mathematical expressions like + or -.

Let's suppose that today is 07-11-2023, so if you use some expression adding 3, the return will be 07-14-2023.

I used "-28" in the expression because it is exactly the number of days of 4 weeks.

the function today(1) return the date of the latest data reload.

You can check this link https://help.qlik.com/en-US/sense/May2023/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunc...

 

Help users find answers! Don't forget to mark a solution that worked for you!