Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
raghavsurya
Partner - Specialist
Partner - Specialist

Displaying Max Month

Hi All,

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.

For example

text Box Guage chart values

Mar 30,000

Feb 20,000

Can anybody suggest how I can do this.

Thanks and Regards,

Raghav

1 Solution

Accepted Solutions
raghavsurya
Partner - Specialist
Partner - Specialist
Author

HI Jonathan,

I tried putting the logic suggested by you. But I am not able to get the desired result. I have attached the qvw file for your reference. Can you please help me out.

Thanks and Regards,

Raghav

View solution in original post

5 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

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

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hi Jonathan,

Thanks a lot. I shall implement this suggestion and get back to you.

Thanks and Regards,

Raghav

raghavsurya
Partner - Specialist
Partner - Specialist
Author

HI Jonathan,

I tried putting the logic suggested by you. But I am not able to get the desired result. I have attached the qvw file for your reference. Can you please help me out.

Thanks and Regards,

Raghav

Not applicable

Hi Raghav

Hope this can solve the problem

Regards!

raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hey..

Thanks a lot. This solved my requirement.

Regards,

Raghav