I have requirement to display the Sales comparison for the (Max month) and (Max Month -1). Since I can't calculate Max month if I use Jan, Feb etc) I have named them as 1,2,3 etc to calculate the data for Max month.
Also I have mapped the month and calendar month in the below order
Month Calendar.Month Sales
1 Jan 10,000
2 Feb 20,000
3 Mar 30,000
and so on........
Now I want to display the Calendar.Month value for the Max month value in the text box. For Example I have a guage chart wherein the values for (Max month) and (Max month-1) displayed. I also want to put text box next to the values to identify to which calenda.month it belongs to.
If you create a "dual" field, then it will have both a text form and a numeric form. You could create a month dual like this:
MONTHS: LOAD Dual(Name, Val) AS dlMonth; LOAD * INLINE [ Name, Val Jan, 1 Feb, 2 .. Dec, 12 ];
When loading from your data source, you can now say myField AS dlMonth if myField contains a numeric from 1-12 or the month name as included in dlMonth.
dlMonth will display text in a text box and can be sorted numerically. You can also force the text representation with text(dlMonth) or force the numeric form with num(dlMonth) if you wish to override QV's choice of form.
Hope that helps
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein