Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
prananellutla
Creator
Creator

convert month name to number and use as measure

Hi

I have 2 dimensions .one among that is month .  I  want to sue scatter plot but ,that chart needs 2 measures.So is it possible to  convert month name to number and use as measure.


thanks

Prana

9 Replies
luismadriz
Specialist
Specialist

Hi,

Sure, Num(Month) but that Scatter Plot may result a bit strange...

Regards,

Luis

devarasu07
Master II
Master II

Hi,


try like to way to get month no from month text field. better share your mock data, we can try to help u

num(month(date#(Month,'MMM'))) as MonthNumber;


sample,

load *, num(month(date#(Month,'MMM'))) as MonthNumber;

load * Inline [

Month

Jan

Feb

Mar

Jun

Jul

]

Capture.JPG

Thanks,

Deva

prananellutla
Creator
Creator
Author

Thanks Luis, I already  tried that code, it works in the table but in the scatter plot  I get " chart is not displayed due to undefined values".

prananellutla
Creator
Creator
Author

Thanks Deva- I am using Qlik sense. And I am looking to modify at the visualization level. not the data model level.

devarasu07
Master II
Master II

Hi,

how your going to use month number as another measure? i don't think this output will give u the right o/p. better share the mock data we can help u.

for the month number extraction from month u also do it in front end just use this as calculated dimension or measure

num(month(date#(Month,'MMM')))

luismadriz
Specialist
Specialist

Hi,

Create a simple table with one dimension and two measures, and confirm those are the values you'd like to plot, than drag a scatter plot over it and select convert..

I say this just because a table may be simpler to troubleshoot.

If possible put that table together and share a screenshot,

I hope it helps,

Cheers,

Luis

prananellutla
Creator
Creator
Author

this is my sample table.I don't think it will work not sure how to use it a measure  though.

if i use the code as a dimension it shows all the values- but when i use it as a measure i see values only where there is null in the other measure.

    

.code as dimension.code as measure(this is my measure 2)
dimension 1num(month((date ])))measure1num(MONTH((#date)))
A12null1.2E+1
A9null9.0E+0
A4null4.0E+0
B118.2-
c314.6-
c114.2-
c213.9-
c613.9-
A213.7-
C413.5-
A1112.8-
prananellutla
Creator
Creator
Author

Hey Deva-  what you asked me is my exact question - how to use the num(month) as a measure?.is it possible if so how?

for the sample data please see my reply to Luis.

luismadriz
Specialist
Specialist

Hi,

I wanted to see the data to show you that it may not be material for a Scatter Plot. For a plot you need a unique dimension and each unique dimension with two numbers so you can plot them. In the data you're showing you only have 4 unique dimensions or 4 unique values so you can expect 4 bubbles....  So you may need to rethink what you really want to show

I hope this helps

Untitled.png