Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Pass a Listbox selected value into Dimension

Hi Guru's

I wanted to pass a Listbox selected value into Dimension to make the Comobo Chart  dynamic. The field name is in a listbox filled by inline code. So far, no success.

Here is the example. The field name is Week NO and  returns last six week week. When I pass the field name weekno using the list box the result is shows selected week only. But result is required last six week no.

Expected Result:

If Selected 10th week I should  display the chart last week No(5,6,7,8,9,10)

If Selected 9th week I should  display the chart last week No(4,5,6,7,8,9)

If Selected 8th week I should  display the chart last week No(3,4,5,6,7,8)

How can I do it?

I created Dummy file.

1 Solution

Accepted Solutions
sunny_talwar

Try using set analysis to achieve this

Sum({<WeekNo = {">=$(=Max(WeekNo)-5)<=$(=Max(WeekNo))"}>}A)

Sum({<WeekNo = {">=$(=Max(WeekNo)-5)<=$(=Max(WeekNo))"}>}B)

.

.

.

When 10 is selected

Capture.PNG

When 9 is selected

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

Try using set analysis to achieve this

Sum({<WeekNo = {">=$(=Max(WeekNo)-5)<=$(=Max(WeekNo))"}>}A)

Sum({<WeekNo = {">=$(=Max(WeekNo)-5)<=$(=Max(WeekNo))"}>}B)

.

.

.

When 10 is selected

Capture.PNG

When 9 is selected

Capture.PNG

Not applicable
Author

Hi Sunny,

Thanks you very much for your help. Sorry for the delay reply. My problem is solved

Thanks

Sharma Rajendra

Not applicable
Author

Hi Sunny,

I applied above conditions in my reports.Some of the reports are working fine without any problem but one report is not working  can you look into the below condition and let me know the issue.

Dimensions Field: =if([Week Number]>vMaxWeekMI-6,Date([Report Display Format],'DD - MMM'))

Expression Field conditions:

A=    =count({<[Week Number] = {">=$(=Max([Week Number])-5)<=$(=Max([Week Number]))"}>}{<Year={2015}>}INCNumber)

B=    =count({<[Week Number] = {">=$(=Max([Week Number])-5)<=$(=Max([Week Number]))"}>}{<Year={2016}>}INCNumber)

C =    =timestamp(Sum({<[Week Number] = {">=$(=Max([Week Number])-5)<=$(=Max([Week Number]))"}>}{<Year={2016}>}[Incident Calculation]) / count({<[Week Number] = {">=$(=Max([Week Number])-5)<=$(=Max([Week Number]))"}>}{<Year={2016}>}INCNumber),'hh:mm')

D =   =Sum({<[Week Number] = {">=$(=Max([Week Number])-5)<=$(=Max([Week Number]))"}>}{<Year={2016}>}[Incident Calculation])

E =    =Sum({<[Week Number] = {">=$(=Max([Week Number])-5)<=$(=Max([Week Number]))"}>}{<Year={2015}>}[Incident Calculation])

Thanks

Sharma Rajendra