
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
concatenating a string and expression output
HI all
i am facing problems in concatenating two values
scenario: i have a date 6/30/2012, but i want to display it as Q2 2012
how can i do that?
i thought of concatenating Q2 with =year(today())-1, but it doesnt work
or can i use some variable, if so how?
pls assist me.
thanks in advance
sujay
- Tags:
- new_to_qlikview
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
expression: ='Q' & ceil(month(MyDate)/3) & ' ' & year(MyDate)
or in the script as a new field: 'Q' & ceil(month(MyDate)/3) & ' ' & year(MyDate) as Quarter
talk is cheap, supply exceeds demand


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Suppose that your field name is myDt:
Let Quarter =
if(month(myDt)>=1 and month(myDt)<=3, 'Q1',
if(month(myDt)>=4 and month(myDt)<=6, 'Q2',
if(month(myDt)>=7 and month(myDt)<=9, 'Q3',
if(month(myDt)>=10 and month(myDt)<=12, 'Q4',
'ND'
)
)
)
);
Your result will be :
$(Quarter) & text(year(myDt))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
expression: ='Q' & ceil(month(MyDate)/3) & ' ' & year(MyDate)
or in the script as a new field: 'Q' & ceil(month(MyDate)/3) & ' ' & year(MyDate) as Quarter
talk is cheap, supply exceeds demand

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would take Gysbert's expression and wrap the Dual() function around it, Then the values will get sorted correctly.
Dual(
'Q' & ceil(month(MyDate)/3) & ' ' & year(MyDate),
QuarterStart(MyDate)
) as Quarter
HIC

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
its perfect
points assigned
thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
THanks &' '& worked !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try
='Q2 ' & text(year(today())-1)
