Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro: Change way of displaying exported values?

Hi everyone,

I could need some help with displaying values exported to Excel.

A button triggers a Macro which exports a random sample stored in a Straight Table to Excel.


Sub ExportToExcel
set obj = ActiveDocument.GetSheetObject("CH12")
obj.ExportEx "C:\temp\Stichprobe_File.xls",1
MsgBox ("Export abgeschlossen, " & "Datei unter Pfad C:\temp\... abgelegt")
End Sub

The random sample in my Straight Table ist displayed as follows:

which is due to my expression:

=Concat(If( Aggr(Rank(Rand()) <= vSampleSize, Änderungsbelegnr), Änderungsbelegnr, Null()), ', ') 

My Excel file stores all values in one row seperated by comma.

However, I would like to have the values stored seperately in different rows like this:

Any ideas how to implement this either already in the QlikView expression or integrated in the Macro?

PS: I already tried to have an indention in my expression, but this will lead to only the first value being displayed in the Straight Table and then exported to Excel.

Regards,

Daniela

0 Replies