Qlik Community

QlikView Documents

Documents for QlikView related information.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER

Tables to text: an example

Anonymous
Not applicable

Tables to text: an example

I just recognized that it seems not possible to create html mails with monospaced fonts with the help of QlikView text alerts. So the following text is nothing more than an interesting but apparently not practicable idea. If anybody knows how to achieve monospaced text then please add a comment.

------------------------

Hello,

I really liked this article here: QlikView App: Send Data In QlikView Alerts

Now I will show you a scheme how to convert nearly every table into text format for sending it via QlikView Mail Alarm.

It's not very complicated, but I think it's worth a look.

This is my example table:

Tab:
LOAD * INLINE [
Country, Sales, Comment
Spain, 1000
Italy, 25000, short comment
Great Britain, 6000000000, this is a very long comment
United States of America, 10000, ?
]
;

It consists of 3 columns. At the end, the textbox should look like that:

(different alignments, sorted descending by sales)

The textbox is calculated by the following expression. Feel free the adapt it to your personal needs!

='Country'& repeat(' ', Len(MaxString(total Country))-Len('Country')) //left aligned
     &' | ' //column delimiter
     &'Sales' & repeat(' ', Len(MaxString(total money(Sales)))-Len('Sales')) //left aligned
     &' | ' //column delimiter
     & repeat(' ', Len(MaxString(total Comment))-Len('Comment'))&'Comment' //right aligned
&chr(13) //line break
&repeat('-',
Len(MaxString(total Country))
+
Len(' | ')
+
Len(MaxString(total money(Sales)))
+
Len(' | ')
+
Len(MaxString(total Comment))
)
&
chr(13) //line break
&
concat(
aggr(

      
Country& repeat(' ', Len(MaxString(total Country))-Len(Country)) //left aligned
      &' | ' //column delimiter
      &repeat(' ', Len(MaxString(total money(Sales)))-Len(money(Sales))) &money(Sales) //right aligned
      &' | ' //column delimiter
      &Comment& repeat(' ', Len(MaxString(total Comment))-Len(Comment)) //left aligned
     
,
Country,Sales,Comment //place your table fields (dimensions) here
      )
,
chr(13) //line break
,-Sales //sort by sales, descending
)

Labels (3)
Comments
Specialist II
Specialist II

Nice work. I'll investigate the other thread too.

0 Likes
Creator II
Creator II

I like your idea !.

CB.

0 Likes
Not applicable

Cool, this idea can apply to different useful places. Bookmarked!

0 Likes
Not applicable

I need a similar thing sometime back. Very useful indeed.

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2016-07-13 03:49 PM
Updated by:
Anonymous