Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

Set Analisys for Rangemax in a month

Hi i need to do a setanalisys for my chart, i have some month to choose, so if i choose one month i need to do set analisys for one month, is i choose more month i need to do the set analisys for the max month i choose (the months will be 2 characters like '01','02'); if i not choose nothing my set analisys must be for the actual month (for example now we are in september so it must be '09'. How can i do that?

I wrote this but not work:

Sum({<MONTH_COMP={"=$(=num(rangemax($(=GetFieldSelections(MONTH_COMP))),'00'))"}>}  TOT_CONSUMO_PERDITE)/1000

 

 

1 Solution

Accepted Solutions
danosoft
Specialist
Specialist
Author

Hi i find the error in my expression

Sum({<MONTH_COMP={"=$(=num(rangemax($(=GetFieldSelections(MONTH_COMP))),'00'))"}>} TOT_CONSUMO_PERDITE)/1000

this "=" not need

so the right expression is:

Sum({<MESE_COMPETENZA={"$(=num(rangemax($(=GetFieldSelections(MESE_COMPETENZA))),'00'))"}>} TOT_CONSUMO_PERDITE)/1000,

but now i have another problem, till i choose max six months, is all ok, if i choose seven months.... the expression show me "-"  why?

View solution in original post

5 Replies
jaibau1993
Partner - Creator III
Partner - Creator III

Hi again! 🙂

Something like

Sum({<MONTH_COMP = {$(=Max(MONTH_COMP))}>} TOT_CONSUMO_PERDITE)

should work.

Regards,

Jaime.

 

danosoft
Specialist
Specialist
Author

Hi, sorry, no it not work and it need to have the "num" function becouse like i said in the post the month are with 2 charatcher like '01'

jaibau1993
Partner - Creator III
Partner - Creator III

Then try 

Sum({<MONTH_COMP = {$(=MaxString(MONTH_COMP))}>} TOT_CONSUMO_PERDITE)

But, maybe, you should cast MONTH_COMP to a number in the load script instead of keeping it as a string, given how you are using that field!

Regards,

Jaime.

danosoft
Specialist
Specialist
Author

no sorry it not work.

my set analisys work ok for the every month:

Sum({<MONTH_COMP={"=$(=num(rangemax($(=GetFieldSelections(MONTH_COMP))),'00'))"}>} TOT_CONSUMO_PERDITE)/1000

but when i choose 2 o 3 months (like: '01','02','03') it take the SUM of all those 3 month, and i want ONLY the SUM for the '03' month in this example

 

danosoft
Specialist
Specialist
Author

Hi i find the error in my expression

Sum({<MONTH_COMP={"=$(=num(rangemax($(=GetFieldSelections(MONTH_COMP))),'00'))"}>} TOT_CONSUMO_PERDITE)/1000

this "=" not need

so the right expression is:

Sum({<MESE_COMPETENZA={"$(=num(rangemax($(=GetFieldSelections(MESE_COMPETENZA))),'00'))"}>} TOT_CONSUMO_PERDITE)/1000,

but now i have another problem, till i choose max six months, is all ok, if i choose seven months.... the expression show me "-"  why?