Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sagar_vij99
Creator
Creator

Fetch multiple values from List Box

Hi All,

I am making a dashboard where i have to show comparison in performance numbers. I have a list box that has list of months and i have two container with same text boxes showing different numbers.

Now i want when someone selects a month, the numbers in one container should show numbers for the selected month and other container should appear for previous month.

Eg. if i select July the one container will show numbers for July other container should display numbers for June.

Sample expressions are '=sum(Headcount)' and "  =num((($(Pro_T)+$(Qct))/$(Avt))*100,'##.00')&'%'  ".

I tried using Set Analysis but could not achieve the same.

Can anyone help me out here. Any suggestion is appreciated..!!


Regards

Sagar

16 Replies
tresesco
MVP
MVP

That could depend on many things like how you are creating month/date field in the script, how you are using the expression...Could you post a sample qvw that we can work upon and help you?

sagar_vij99
Creator
Creator
Author

I have made a separate table where i have listed all months and months number. i did this just to sort list box month wise. And field P_Month is synced with field in other tables.

So basically in the data also i am getting just the month name but not dates.

Month_Table:

Load * inline

[

P_Month,Month_num

January,1

February,2

March,3

April,4

May,5

June,6

July,7

August,8

September,9

October,10

November,11

December,12

];

tresesco
MVP
MVP

Do you have data for multiple years or one year only? What your date field?

sagar_vij99
Creator
Creator
Author

I have data for multiple years. I do not have any field for date but yes i have columns for month and year named as P_Month and P_Year in all tables.

tresesco
MVP
MVP

Create a new field as Month_Name in the transaction table like:

SET MonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

Load

          Headcount,

          P_Month,

          P_Year,

          MonthName(MakeDate(P_Year, P_Month)) as Month_Name

From <>;

Then in the front end, try previous month expression, like:

=sum({<Month_Name={'$(=Monthname(Addmonths(Max(Month_Name),-1)))'}>}Headcount)

sagar_vij99
Creator
Creator
Author

I tried the solution but Month field has text values in it so i am getting '-' in the new column created. How should i handle it..?

tresesco
MVP
MVP

Have you set the system variable setting I showed above? That should convert the full month names into proper month field. I guess now you should share your sample qvw to move forward.

sagar_vij99
Creator
Creator
Author

I have not got any option here to attach files. Advanced editor is also missing

sagar_vij99
Creator
Creator
Author

I do not mean to offend you but the set variable has 'monthnames' but we are not using the same name anywhere.