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: 
Not applicable

Set Analysis and functions...

Hello everyone,

Can we make work a set analysis with a function inside ??

This is my expression :

sum({<Soldes.num_Mois={'10'}>}Soldes.solde)

It works perfectly but I would like the 10 ( the number of the current month to be calculated automatically), so I've tried:

({<Soldes.num_Mois={ Num(Month(Today()))  }>}Soldes.solde)

But there is an "error modifier ad hoc element list"

I have also tried :

({<Soldes.num_Mois={ "Num(Month(Today()))"  }>}Soldes.solde)

The Expresision is "ok" but the result is not what I expect, the result is as if I hadn't put any set analysis...

Do you know what is wrong in the syn,tax?

Thank you for your help

1 Solution

Accepted Solutions
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Laura,

Have you tried this?

$(=max(Month(Today())))

Instead of

"Num(Month(Today()))" .


Miguel 

View solution in original post

8 Replies
villegasi03
Creator
Creator

add a variable for  Num(Month(Today()) and then replace it in the expression with the variables

Not applicable
Author

I have also tried it and it doesn't work as well

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Laura,

Have you tried this?

$(=max(Month(Today())))

Instead of

"Num(Month(Today()))" .


Miguel 

nagaiank
Specialist III
Specialist III

Try

({<Soldes.num_Mois={ $(Num(Month(Today())))  }>}Soldes.solde)

Not applicable
Author

Thank you, it works !!

But I don't understand why 😕

Can you explain me how the "max" make it work ?

villegasi03
Creator
Creator

yes. please do. seems like there would only be one max month to todays month. Was it the addition of the " = " that made that work?

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Laura,

Please read this paper, hope it help you understand the solution:

https://community.qlik.com/servlet/JiveServlet/previewBody/6798-102-1-8466/Les_set_analysis_ENG%5B1%...

Thanks for marking my answer as the correct one

Have a happy weekend

miguelbraga
Partner - Specialist III
Partner - Specialist III

Also you can see this post on the community:

https://community.qlik.com/docs/DOC-6593

Have a good job