Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Select 1 value in listbox, display 5 in objects

Hi,

I need to be able to select 1 weeknumber and get also the 4 week previous weeks in my charts.

So: select in listbox week 5

Chart needs to display week 1 to 5

and also

an other chart only needs to show the selected week.

I tried with Getfieldselections and Get...selections-1 but that doens't work.

Thanks for your help

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You this expression

     Sum({<Week={">=$(=Max(Week)-5)<=$(=Max(Week))"}>} Sales)

Hope it helps

Celambarasan

View solution in original post

9 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You this expression

     Sum({<Week={">=$(=Max(Week)-5)<=$(=Max(Week))"}>} Sales)

Hope it helps

Celambarasan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try the following expression

Sum({<Year=, Month=, Week=, DateFieldName={">=$(=WeekStart(Max(DateFieldName), -4))<=$(=Max(DateFieldName))"}>} Sales)

Hope this helps you.

Regards,

Jagan.

Michiel_QV_Fan
Specialist
Specialist
Author

Celambarasan

Do you have an additional solution to use this in solution in this expression:

Sum (#Uren) / aggr(NODISTINCT Sum (#Uren), Week, REGIO)

The combination of calculations looks too much for set analysis.

Thanks

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You mean with the week expression or this is new one?If so can you give me a brief about the expression usage?

Celambarasan

Michiel_QV_Fan
Specialist
Specialist
Author

The statement is like this now:

sum({<Week={">=$(=Max(Week)-3)<=$(=Max(Week))"}>} #Uren)

/

aggr(NODISTINCT Sum ({<Week={">=$(=Max(Week)-3)<=$(=Max(Week))"}>} #Uren), Week, REGIO)

It has to display 4 weeks with the percentage of the hours compared to the aggr calculation.

But only the 4 weeks based on 1 week selected.

thnx

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Are you looking for this?

    

Sum ({<Week={">=$(=Max(Week)-5)<=$(=Max(Week))"} #Uren)/Sum(TOTAL<Week,REGIO> {<Week={">=$(=Max(Week)-5)<=$(=Max(Week))"}>} #Uren)

Celambarasan

Michiel_QV_Fan
Specialist
Specialist
Author

I'm looking for the idea but it doesn't give any results

I did try total but that gave me the wrong results, therefore I used aggr. Maybe aggr doesn't function with set analysis ...

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     If your getting wrong results then try with this approach.

     =Sum ({<Week={">=$(=Max(Week)-5)<=$(=Max(Week))"} #Uren)/Sum(TOTAL {<Week={">=$(=Max(Week)-5)<=$(=Max(Week))"}>} aggr(NODISTINCT Sum (#Uren), Week, REGIO))

it helps you?

Celambarasan

Michiel_QV_Fan
Specialist
Specialist
Author

No, it doesnt give back multiple week.

The formula doesnt give any errors, it just doesnt calculate more than 1 week.

I look into it further,

Thanks for your help