Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

variable storing

Hi all,

@tresesco 

@sunny_talwar 

 

i have field called Month  like that   values  201801,20802,201804... like so on..

i want to derive from that field  to other format  like    Jan-19   

i want to store this in variable. 

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

How should your variable value look like if you have many months in the scope, comma separated? You may try like:

=Concat(Date(Date#(Month,'YYYYMM'),'MMM-YY'), ',')

Capture.PNG

View solution in original post

7 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Sonia,

You can convert the format using below functions.

Monthname(Date(Date#(Month,'YYYYMM'))) as Newformat.

Once you have this new field, you can use Peek function to get desired value in variable.

 

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
soniasweety
Master
Master
Author

its giving me null 😞

tresesco
MVP
MVP

How should your variable value look like if you have many months in the scope, comma separated? You may try like:

=Concat(Date(Date#(Month,'YYYYMM'),'MMM-YY'), ',')

Capture.PNG

soniasweety
Master
Master
Author

@tresesco 

 

No No  my field like below

Month

201801

201802

201901

201902

201903

201904    like that  

i want to store the format  MMM-YY format  in variable.. that variable i want to use in stright table expression

tresesco
MVP
MVP

The expression I showed above could be used as your variable definition. May be you have to explain a bit more about your expression you want to use variable in.

soniasweety
Master
Master
Author

tried this working fine . thanks for your response. @tresesco 

 

=DATE(Date#(Max(Month)&'01','YYYYMMDD'),'MMM-YY')

durgesh22
Creator
Creator

To make it more simple you can use below .

=Date(Date#(Month,'YYYYMM'),'MMM-YY')